1.2. qlinks.lattice.square_lattice#
Classes
|
|
|
Plaquette operator on a square lattice. |
|
A square lattice with periodic boundary condition. |
|
- class qlinks.lattice.square_lattice.SquareLattice(length_x, length_y, links=None)[source]#
Bases:
object
A square lattice with periodic boundary condition.
- Parameters:
- length_x: int#
- length_y: int#
- property shape: Tuple[int, int]#
- property size: int#
- property n_links: int#
- property index: int#
- Returns:
The integer representation of the binary link data.
- Raises:
ValueError – If the link data is not binary or emtpy.
- axial_flux(idx, axis=0)[source]#
Compute the electric flux along the axis.
▲ | │ │ | ▼ ▲
- ──►o──|──►o──► │
▲ | │
—│——▼—- axis=1 ◄──o◄─|───o◄──
▲ | │ │ | ▼
axis=0 ──►
- Parameters:
idx (int) – The idx-th row or column in lattice. Negative values or values greater than the length are permissible.
axis (int | None) – 0 for x-axis and 1 for y-axis, default 0.
- Returns:
The total electric flux flowing along the axis, in unit of e/2.
- Return type:
float
Notes
The flux cross-section is perpendicular to the axis.
- bipartite_index(idx, axis=0)[source]#
Bi-partition the lattice links along the axis at the idx-th row or column.
- Parameters:
idx (int) – The idx-th row or column in lattice.
axis (int | None) – 0 for x-axis and 1 for y-axis, default 0.
- Return type:
Tuple[ndarray[Any, dtype[int64]], ndarray[Any, dtype[int64]]]
- Returns: A tuple of two arrays:
first_partition_idx: The indices of links in the first partition.
second_partition_idx: The indices of links in the second partition.
- class qlinks.lattice.square_lattice.LocalOperator(*args, **kwargs)[source]#
Bases:
Protocol
- lattice: SquareLattice#
- __init__(*args, **kwargs)#
- class qlinks.lattice.square_lattice.Plaquette(lattice, site, _mask=None)[source]#
Bases:
LocalOperator
Plaquette operator on a square lattice.
- Parameters:
lattice (SquareLattice) – The lattice on which the plaquette operator acts.
site (Site) – The site on lower-left corner of the plaquette.
_mask (int) – The binary mask of the plaquette operator, optional.
Examples:
- __init__(lattice, site, _mask=None)#
- Parameters:
lattice (SquareLattice)
site (Site)
_mask (int)
- Return type:
None
- class qlinks.lattice.square_lattice.Vertex(lattice: 'SquareLattice', site: 'Site', _mask: 'int' = None)[source]#
Bases:
LocalOperator
- Parameters:
lattice (SquareLattice)
site (Site)
_mask (int)
- __init__(lattice, site, _mask=None)#
- Parameters:
lattice (SquareLattice)
site (Site)
_mask (int)
- Return type:
None