QED LGT Model Class

U(1) lattice gauge-theory model helper with optional matter fields and symmetry-sector construction.

class edlgt.models.QED_model.QED_Model(spin, pure_theory, bg_list=None, plaq_basis=False, link_symmetries=True, get_only_bulk=False, block_projectors=None, **kwargs)[source]

Bases: QuantumModel

QED lattice gauge model with optional matter fields.

Initialize the QED model and construct its symmetry sector.

Parameters:
  • spin (float or str = integrated) – Gauge-link spin representation.

  • pure_theory (bool) – If True, build the pure-gauge theory (no matter fields).

  • bg_list (list, optional) – Optional background-charge configuration used during local-basis projection.

  • get_only_bulk (bool, optional) – Restrict gauge-invariant local states to bulk-compatible ones when supported by the operator factory.

  • block_projectors (dict, optional) – Plaquette-block-LBO projectors, required when plaq_basis=True. lvals is then the coarse super-lattice (one 2x2 block per site). Keyed by position class: <class> is the dense (D, k) block projector and <class>_embedding the sparse (prod_dim, D) subsystem embedding, both from extract_plaquette_block_projectors().

  • **kwargs – Arguments forwarded to QuantumModel.

build_Hamiltonian(g, m=None, theta=0.0, dtype_mode='auto')[source]

Dispatch to the appropriate QED Hamiltonian builder.

Parameters:

dtype_mode (str or bool, optional) – “auto”, “real”, “complex”, or legacy bool flag.

build_truncated_Hamiltonian(g, m=None, theta=0.0, dtype_mode='auto')[source]

Assemble the QED Hamiltonian.

Parameters:
  • g (float) – Gauge coupling.

  • m (float, optional) – Bare fermion mass (used only when matter is present).

  • theta (float, optional) – Topological-angle coupling parameter.

  • dtype_mode (str or bool, optional) – “auto”, “real”, “complex”, or legacy bool flag.

build_integrated_Hamiltonian(g, m, theta=0.0, dtype_mode='auto')[source]

Assemble the integrated-gauge 1D QED Hamiltonian.

Parameters:

dtype_mode (str or bool, optional) – “auto”, “real”, “complex”, or legacy bool flag.

reconstruct_integrated_E2_from_N(density_obs_name='N', density_corr_obs_name='N_N', state_index=None, dynamics=False, compute_density_corr=True, print_values=True)[source]

Reconstruct link-resolved <E^2> in integrated 1D QED from matter density.

Parameters:
  • density_obs_name (str, optional) – Key in self.res containing measured site-resolved <N_k>.

  • density_corr_obs_name (str, optional) – Key in self.res containing measured two-point correlator <N_k N_l>.

  • state_index (int or None, optional) – Eigenstate index used to compute <N_k N_l> on the fly when density_corr_obs_name is missing and compute_density_corr=True. If None and only one eigenstate is available, index 0 is used.

  • dynamics (bool, optional) – If True, interpret state_index as a time index and compute missing correlators on self.H.psi_time[state_index] instead of self.H.Npsi[state_index].

  • compute_density_corr (bool, optional) – If True, compute <N_k N_l> when not already present in self.res. If False, missing correlations raise KeyError.

  • print_values (bool, optional) – If True, print link-resolved reconstructed values and their average using the same style as local observable measurements.

Returns:

Link-resolved reconstructed Casimir values <E_{k,k+1}^2> with shape (n_sites - 1,).

Return type:

numpy.ndarray

Notes

The reconstruction uses

E_n = sum_{k=0}^n [ q_k + N_k + ((-1)^k-1)/2 ].

Therefore:

<E_n^2> = B_n^2 + 2 B_n sum_{k<=n}<N_k> + sum_{k,l<=n}<N_k N_l>,

where B_n = sum_{k=0}^n [q_k + ((-1)^k-1)/2].

get_fermionic_string_correlator(state=None, state_index=None, dynamics=False, print_values=False)[source]

Measure the gauge-invariant fermionic string correlator matrix.

Notes

For the integrated 1D QED model, the off-diagonal entries are built as <Q_dag(i) U(i+1) … U(j-1) Q(j)> for i < j, with Q_dag = Sm, Q = Sp, and U = P_psi = Sz. For the truncated dressed-site model, the same gauge-invariant string is represented by <Q_px_dag(i) U(i+1) … U(j-1) Q_mx(j)>. In both cases, the diagonal is the local density <N(i)>.

measure_fermionic_nongaussianity(state=None, state_index=None, dynamics=False, print_value=True, eig_tol=1e-10)[source]

Measure the fermionic non-Gaussianity from the string correlator.

boundary_flux_signatures(keep_sites, block_coords, unique_subsys_configs, axes=('x', 'y'))[source]

Compute the boundary electric-flux signature of every block RDM row.

Parameters:
  • keep_sites (list[int]) – The four block site indices, ascending (column order of unique_subsys_configs).

  • block_coords (list[tuple]) – Coordinates of keep_sites (same order).

  • unique_subsys_configs (numpy.ndarray) – (D, 4) table of the distinct 4-site sub-configurations appearing in the sector; row r is the basis label of RDM row r, column j the local-state label at keep_sites[j].

  • axes (tuple[str, str], optional) – Plaquette-plane axes.

Returns:

(D, 8) real array: the eight outward-link electric fields (two per site) of each RDM basis row. Rows with identical signatures share a boundary flux (one superselection block).

Return type:

numpy.ndarray

Notes

In the gauge-invariant (electric) basis the link operators E_m{d}/E_p{d} are diagonal, so the electric field a link carries for a given local-state label is just that operator’s diagonal entry at that label. Columns are laid out leg-major (site 0’s two links, then site 1’s, …).

extract_plaquette_block_projectors(state, truncation=0.0001, axes=('x', 'y'), flux_tol=1e-09, return_full_space=False, only_classes=None, class_representatives=None)[source]

Extract per-position-class plaquette-block LBO projectors from a state.

This is the “instance A” half of the plaquette-block LBO flow: from a converged state of THIS dressed-site model, learn one flux-block-wise RDM projector per 2x2-block position class. The result feeds a coarse “instance B” plaquette model, QED_Model(plaq_basis=True, block_projectors=<result>) on the lvals // 2 super-lattice.

Parameters:
  • state (QMB_state) – The reference state (typically the ground state self.H.Npsi[0]).

  • truncation (float, optional) – Keep block-RDM eigenvectors with eigenvalue above this. -1 keeps everything (lossless: the coarse model reproduces this one exactly).

  • axes (tuple[str, str], optional) – Plaquette-plane axes.

  • flux_tol (float, optional) – Rounding tolerance for grouping RDM rows by boundary flux.

  • return_full_space (bool, optional) – If True, also store the sparse subsystem embedding (build_subsystem_sector_embedding(), shape (prod_dim, D)) under "<label>_embedding" – required by the plaquette model, which projects super-site operators in two cheap stages P^dag (S^dag O S) P without forming a dense (prod_dim, k).

  • only_classes (list[str], optional) – Restrict extraction to these position classes (e.g. exactly the classes a disjoint tiling uses – avoids building unused, possibly huge, embeddings such as the bulk class).

  • class_representatives (dict, optional) – Explicit representative block per class ({"label": {"sites", "coords", "anchor"}}), e.g. the DISJOINT tiling blocks from tile_plaquette_blocks(). Defaults to the overlapping enumeration (enumerate_block_classes()). Passing the disjoint blocks matters for edge classes, whose disjoint block can sit at a different position (different RDM) than the overlapping representative.

Returns:

  • projectors (dict[str, numpy.ndarray]) – {label: P} with P of shape (D, k) in the RDM-subset basis (plus sparse (prod_dim, D) "<label>_embedding" entries when return_full_space).

  • diagnostics (dict[str, dict]) – Per-class diagnostics from flux_block_projector(), plus the representative sites/anchor.

Raises:

ValueError – If the model has no symmetry sector (the construction relies on the sector-conditioned subsystem basis and on boundary flux being a good quantum number) or is not at least 2D.

build_plaquette_Hamiltonian(g, dtype_mode='auto')[source]

Assemble the plaquette-basis QED Hamiltonian.

Parameters:

dtype_mode (str or bool, optional) – “auto”, “real”, “complex”, or legacy bool flag.

check_symmetries()[source]

Check link-symmetry constraints on measured electric fields.

QED_Hamiltonian_couplings(g, m=None, theta=0.0, magnetic_basis=False)[source]

Set QED Hamiltonian couplings from physical parameters.

Parameters:
  • g (float) – Gauge coupling.

  • m (float, optional) – Bare mass parameter (used only with matter).

  • theta (float, optional) – Topological-angle parameter.

  • magnetic_basis (bool, optional) – If True, use the alternative magnetic-basis normalization.

Returns:

Stores couplings in self.coeffs.

Return type:

None

overlap_QMB_state(name)[source]

Return predefined benchmark basis configurations for selected labels.

Parameters:

name (str) – Label of a predefined reference configuration.

Returns:

Configuration in the model symmetry-sector basis.

Return type:

numpy.ndarray

print_state_config(config, amplitude=None)[source]

Log a readable per-site decomposition of a QED basis configuration.