qlinks.conventions package#
Submodules#
qlinks.conventions.qlm module#
- qlinks.conventions.qlm.staggered_charges_from_sites(lattice, *, magnitude=1, convention='even_positive')[source]#
Generate staggered background charges on lattice sites.
The charge is assigned by the parity of the unit-cell coordinate:
eta(r) = (-1) ** sum(cell coordinates)
For a square lattice, this is simply:
eta(x, y) = (-1) ** (x + y)
- Parameters:
lattice (LatticeGraph) – Lattice whose sites carry the Gauss-law charges.
magnitude (int) – Absolute value of the staggered charge.
convention (Literal['even_positive', 'odd_positive']) –
- “even_positive”:
even sublattice gets +magnitude, odd sublattice gets -magnitude.
- ”odd_positive”:
even sublattice gets -magnitude, odd sublattice gets +magnitude.
- Returns:
Integer array of shape (lattice.num_sites,), ordered by site id.
- Return type:
charges
- qlinks.conventions.qlm.square_qdm_staggered_charges(lattice, *, magnitude=None, charge_normalization='spin_half', convention='even_positive')[source]#
Staggered charges for the square-lattice QDM-to-QLM mapping.
For the current spin-half flux convention E_l in {-1, +1}, the close-packed QDM constraint
one dimer touching each site
maps naturally to a staggered Gauss law with charge magnitude 1 on the square lattice.
- Parameters:
lattice (SquareLattice) – SquareLattice instance.
charge_normalization (Literal['integer_flux', 'spin_half']) –
- “spin_half”:
The user-facing charges are ±1, matching the spin-half flux convention.
- ”integer_flux”:
The user-facing charges are ±2, matching the integer-flux convention where E_l in {-2, 0, +2}.
convention (Literal['even_positive', 'odd_positive']) – Which sublattice receives the positive charge.
magnitude (int | None)
- Returns:
Integer array ordered by site id.
- Return type:
charges
Module contents#
- qlinks.conventions.square_qdm_staggered_charges(lattice, *, magnitude=None, charge_normalization='spin_half', convention='even_positive')[source]#
Staggered charges for the square-lattice QDM-to-QLM mapping.
For the current spin-half flux convention E_l in {-1, +1}, the close-packed QDM constraint
one dimer touching each site
maps naturally to a staggered Gauss law with charge magnitude 1 on the square lattice.
- Parameters:
lattice (SquareLattice) – SquareLattice instance.
charge_normalization (Literal['integer_flux', 'spin_half']) –
- “spin_half”:
The user-facing charges are ±1, matching the spin-half flux convention.
- ”integer_flux”:
The user-facing charges are ±2, matching the integer-flux convention where E_l in {-2, 0, +2}.
convention (Literal['even_positive', 'odd_positive']) – Which sublattice receives the positive charge.
magnitude (int | None)
- Returns:
Integer array ordered by site id.
- Return type:
charges
- qlinks.conventions.staggered_charges_from_sites(lattice, *, magnitude=1, convention='even_positive')[source]#
Generate staggered background charges on lattice sites.
The charge is assigned by the parity of the unit-cell coordinate:
eta(r) = (-1) ** sum(cell coordinates)
For a square lattice, this is simply:
eta(x, y) = (-1) ** (x + y)
- Parameters:
lattice (LatticeGraph) – Lattice whose sites carry the Gauss-law charges.
magnitude (int) – Absolute value of the staggered charge.
convention (Literal['even_positive', 'odd_positive']) –
- “even_positive”:
even sublattice gets +magnitude, odd sublattice gets -magnitude.
- ”odd_positive”:
even sublattice gets -magnitude, odd sublattice gets +magnitude.
- Returns:
Integer array of shape (lattice.num_sites,), ordered by site id.
- Return type:
charges