Skip to content

sotashimozono/Lattice2D.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

146 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lattice2D.jl

docs: dev Julia Code Style: Blue codecov Build Status Aqua QA License

Features

This package provides two dimensional lattices. If you know unit cell information (basic vectors, connection), you can construct arbitrary lattices.

Available lattices by defaults are ...

  • Square lattice
  • Triangular lattice
  • Honeycomb lattice
  • Kagome lattice
  • Lieb lattice
  • Shastry-Sutherland lattice

Installation

using Pkg
Pkg.add("Lattice2D")

Example

Here we show Honeycomb lattice as an example. The Module enables us to have unit cell informations and connection infos, reciprocal vectors etc. And more, we can know the graph is bipartite or not, we can set periodic boundary and open boundary.

using Lattice2D

# Create a 4x4 Honeycomb lattice with Periodic Boundary Conditions (PBC)
lat = build_lattice(Honeycomb, 4, 4; boundary=PBC())

# Check basic properties
println("Total sites: ", lat.N)
println("Is bipartite? ", lat.is_bipartite)

Honeycomb Lattice

Plots dependency

Lattice2D re-exports materialize and require_finite from LatticeCore. Plotting helpers (e.g. via Plots.plot(lat)) are provided through LatticeCore's LatticeCorePlotsExt package extension, which activates only when both LatticeCore and Plots are loaded. As a result:

  • A user that only computes neighbours / bonds / plaquettes / momenta does not need Plots and pays no precompilation cost for it.
  • A user that wants visualisation should using Plots alongside using Lattice2D; the recipe / plot method is then picked up automatically.

The docs/ build environment loads Plots explicitly so the gallery figures are rendered; see docs/src/Gallery.md for visualisation examples.

Note: Project.toml currently lists Plots as a regular dependency for backward compatibility with downstream code that imports it transitively. Migrating it to a [weakdeps] extension is tracked separately and will be a breaking release.

Quality assurance

The test suite runs Aqua.jl checks (ambiguities / unbound args / undefined exports / stale deps / piracy / persistent tasks) on every CI build, with Plots excluded from stale_deps while its migration to [weakdeps] is pending.

Contributing

Contributions are welcome! Please feel free to open an Issue or submit a pull requests.

About

A Julia package for generating and manipulating 2D lattice structures for quantum many-body physics simulations.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages