qrunch.quantum.algorithms.second_quantization.quantum_selected_configuration_interaction.subspace_state_generator
Protocols for the states defining a QSCI diagonalization subspace, and their generators.
Classes
Protocol for a state whose samples contribute determinants to a QSCI diagonalization subspace. |
|
Protocol for strategies generating the states whose samples define a diagonalization subspace. |
- class SubspaceState
Bases:
ProtocolProtocol for a state whose samples contribute determinants to a QSCI diagonalization subspace.
A subspace state describes which state to prepare without fixing the Hamiltonian it is prepared under or the reference state it builds upon. The caller realizes it into a circuit, so successive states of one run may be realized under different Hamiltonians and on top of different references – as adaptive strategies require, where both are refined from the determinants found so far.
- __init__(*args, **kwargs)
- create_circuit(hamiltonian: SecondQuantizedHamiltonian, reference_circuit: Circuit) Circuit
Build the circuit preparing this state under the given Hamiltonian and reference.
Implementations may be randomized, in which case repeated calls return different circuits.
- Parameters:
hamiltonian (SecondQuantizedHamiltonian) – The second-quantized Hamiltonian to prepare the state under.
reference_circuit (Circuit) – Circuit preparing the reference state this state builds upon.
- Return type:
- class SubspaceStateGenerator
Bases:
ProtocolProtocol for strategies generating the states whose samples define a diagonalization subspace.
In quantum-selected configuration interaction (QSCI), the Hamiltonian is diagonalized in the subspace spanned by Slater determinants sampled from a set of quantum circuits. A
SubspaceStateGeneratordecides which states are sampled; it does not compile them, so it never sees the Hamiltonian nor the reference state they build upon.- __init__(*args, **kwargs)
- generate() Iterator[SubspaceState]
Yield the states whose samples define the diagonalization subspace.
- Return type:
Iterator[SubspaceState]