Closed Yaraslaut closed 1 year ago
Hi, I was trying to plot some simple lattices, such as
l = Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]], name=:Square)
withplot(l,4)
And I see following picture
This is the "correct" picture of the lattice you just defined. Of course some explanations are needed: the small solid circles are the two points of the lattice in the unit cell, and lines denote the bonds that are within and beyond the unit cell.
To get an ordinary view of the bonds on a finite lattice, you should not use a lattice that is defined only in a unit cell with periodic boundary conditions such as
Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]])
This kind of lattice is a representation of the infinite translation-invariant lattice.
On the contrary, it is recommended to define a lattice containing several unit cells with the open boundary condition:
# construct the unit cell first
unitcell = Lattice((0.0, 0.0); vectors=[[1.0, 0.0], [0.0, 1.0]], name=:Square)
# construct a finite lattice containing several unit cells with the open boundary condition
finitelattice = Lattice(unitcell, (4, 4))
Then the plot of this finite lattice would be just fine:
plot(finitelattice, 2)
The above code displays the points (0th order bonds), the nearest-neighbor bonds and the next-nearest-neighbor bonds. That it to say, up to the 2nd nearest neighbor of bonds are shown. When only some specific orders of nearest-neighbor bonds are wanted, a filter can be passed to the plot function:
plot(finitelattice, 4, bond::Bond->bond.kind in (0, 2))
Oh, I see Thanks a lot for explanation Maybe I can write something in documentation for that :)
Hi, I was trying to plot some simple lattices, such as![image](https://github.com/Quantum-Many-Body/QuantumLattices.jl/assets/44506630/41f82713-867a-418c-a784-192a372587d8)
l = Lattice((0.0, 0.0), (0.5, 0.5); vectors=[[1.0, 0.0], [0.0, 1.0]], name=:Square)
withplot(l,4)
And I see following picture