This section summarizes the main supported workflows and points to maintained example scripts.
- Build a
HilbertSpaceon a lattice. - Create a
Hamiltonianand add terms through operator factories. - Build the sparse or dense matrix.
- Diagonalize and inspect the low-energy spectrum.
Reference example:
examples/algebra/example_hilbert_and_custom_hamiltonian.py
- Construct a
QuadraticHamiltonian. - Add onsite, hopping, or pairing terms.
- Build either the single-particle matrix or the full BdG matrix.
- Use
diagonalizing_bogoliubov_transformfor the Qiskit-style orbital transform. - Use
to_qiskit_hamiltonian,from_qiskit_hamiltonian, orfrom_openfermion_hamiltonianfor external interoperability when optional dependencies are installed.
Reference example:
examples/algebra/example_quadratic_single_particle.py
- Build reduced density matrices with
general_python.physics.density_matrix. - Compute von Neumann or Renyi entropies with
general_python.physics.entropy. - Compute mutual information between sites.
Reference example:
examples/physics/example_entropy_density_matrix.py
- Diagonalize a Hamiltonian.
- Use
ham.time_evofor evolved states. - Compute level-spacing diagnostics with
gap_ratio.
Reference example:
examples/physics/example_time_evolution_and_spectral_stats.py
- Use
SquareLatticeorHoneycombLattice. - Extract neighbors directly from the lattice.
- Feed those bonds into Hamiltonian assembly.
Reference example:
examples/workflows/example_lattice_driven_hamiltonian.py