quchip.engine.basis

Local energy-basis resolution and explicit transformation records.

Functions

resolve_device_basis(device, *, basis[, levels])

Resolve a device from its exact authored static Hamiltonian.

resolve_local_basis(hamiltonian, *[, basis, ...])

Resolve one fixed local solver basis from a static authored Hamiltonian.

Classes

BasisRecord(kind, vectors, energies, ...[, ...])

One device's fixed authored-to-solver transformation.

class quchip.engine.basis.BasisRecord(kind, vectors, energies, energy_vectors, native_dim, resolved_dim, authored_hamiltonian=None)[source]

Bases: object

One device’s fixed authored-to-solver transformation.

Variables:
  • kind ({"native", "eigen"}) – Selected solver-basis policy.

  • vectors (array_like) – Solver basis vectors as authored-basis columns.

  • energies (array_like) – Retained isolated eigenenergies in GHz.

  • energy_vectors (array_like) – Isolated energy eigenvectors as authored-basis columns.

  • resolved_dim (native_dim,) – Authored and retained local dimensions.

  • authored_hamiltonian (array_like or None) – Captured authored-basis Hamiltonian in GHz, when retained.

kind: Literal['native', 'eigen']
vectors: Any
energies: Any
energy_vectors: Any
native_dim: int
resolved_dim: int
authored_hamiltonian: Any = None
energy_state(level)[source]

Return one captured isolated energy ket in the solver basis.

Parameters:

level (int) – Zero-based isolated energy level.

energy_to_solver()[source]

Return the energy-to-solver map, or None when the bases coincide.

property projector: Any

Projector onto the retained authored subspace.

transform_operator(operator)[source]

Apply the recorded authored-to-solver transformation to an operator.

Parameters:

operator (array_like) – Square operator with shape (native_dim, native_dim).

level_operator()[source]

Return the energy-level index operator in the resolved solver basis.

authored_level_operator()[source]

Energy-level index in the authored basis, on the retained subspace.

quchip.engine.basis.resolve_local_basis(hamiltonian, *, basis='native', levels=None, authored_hamiltonian=None)[source]

Resolve one fixed local solver basis from a static authored Hamiltonian.

authored_hamiltonian is the authored form of hamiltonian. The record keeps it, and its algebra can prove a diagonal matrix.

quchip.engine.basis.resolve_device_basis(device, *, basis, levels=None)[source]

Resolve a device from its exact authored static Hamiltonian.

Concrete device values give a concrete record, also inside a JAX trace.