PlaquetteTerm Class
Plaquette Hamiltonian contribution and plaquette-observable measurements on lattice models.
- class edlgt.modeling.plaquette_term.PlaquetteTerm(axes, op_list, op_names_list, print_plaq=True, **kwargs)[source]
Bases:
QMBTermFour-body plaquette term on a lattice.
The class supports both:
direct sparse-matrix construction (no symmetry-sector reduction), and
symmetry-sector workflows where Hamiltonian contributions are returned as
(rows, cols, vals)triplets.
Initialize a plaquette term definition.
- Parameters:
axes (
list) – Two lattice axes defining the plaquette plane (for example["x", "y"]).op_list (
list) – Operators used to build the plaquette term.op_names_list (
list) – Human-readable names corresponding toop_list.print_plaq (
bool, optional) – IfTrue, print plaquette values when callingget_expval().**kwargs – Additional keyword arguments forwarded to
QMBTerm.
- Return type:
- get_hamiltonian(strength, add_dagger=False, mask=None)[source]
Build the plaquette Hamiltonian contribution.
The plaquette term is summed over all lattice sites where a plaquette is defined (and where
maskallows it), then multiplied bystrength.- Parameters:
strength (
scalar) – Coupling constant multiplying the plaquette term.add_dagger (
bool, optional) – IfTrue, add the Hermitian conjugate of the constructed term.mask (
numpy.ndarray, optional) – Boolean mask controlling where the local term is applied.
- Returns:
Return type depends on the current workflow:
if
self.sector_configs is None: sparse matrix Hamiltonian term;otherwise:
(row_list, col_list, val_list)as three NumPy arrays in the symmetry-reduced basis.
- Return type:
- Raises:
TypeError – If
strengthis not scalar oradd_daggeris invalid.
- get_Hamiltonian(strength, add_dagger=False, mask=None)
Build the plaquette Hamiltonian contribution.
The plaquette term is summed over all lattice sites where a plaquette is defined (and where
maskallows it), then multiplied bystrength.- Parameters:
strength (
scalar) – Coupling constant multiplying the plaquette term.add_dagger (
bool, optional) – IfTrue, add the Hermitian conjugate of the constructed term.mask (
numpy.ndarray, optional) – Boolean mask controlling where the local term is applied.
- Returns:
Return type depends on the current workflow:
if
self.sector_configs is None: sparse matrix Hamiltonian term;otherwise:
(row_list, col_list, val_list)as three NumPy arrays in the symmetry-reduced basis.
- Return type:
- Raises:
TypeError – If
strengthis not scalar oradd_daggeris invalid.
- get_expval(psi, component='real', stag_label=None)[source]
Compute plaquette expectation values site by site and aggregate statistics.
- Parameters:
psi (
QMB_state) – Quantum many-body state on which the expectation values are evaluated.component (
str, optional) – Component of the plaquette operator to measure. Allowed values are"real"(Hermitian part) and"imag"(anti-Hermitian part).stag_label (
str, optional) – Optional staggered-site selector passed through the common validation logic. Allowed values are"even"and"odd". IfNone, all plaquettes are considered.
- Returns:
Results are stored on the instance attributes
obs,var,avg, andstd.- Return type:
- Raises:
TypeError – If
psiis not aQMB_stateinstance.ValueError – If
componentis not"real"or"imag".
Notes
In symmetry-sector mode, variances are currently not computed.
- print_plaquette(sites_list, value)[source]
Log a formatted ASCII representation of a plaquette value.
- Parameters:
- Return type:
- Raises:
TypeError – If
sites_listis not a list orvalueis not a float.ValueError – If
sites_listdoes not contain exactly four entries.
- print_Plaquette(sites_list, value)
Log a formatted ASCII representation of a plaquette value.
- Parameters:
- Return type:
- Raises:
TypeError – If
sites_listis not a list orvalueis not a float.ValueError – If
sites_listdoes not contain exactly four entries.