qrunch.quantum.algorithms.second_quantization.quantum_selected_configuration_interaction.creators

Subspoace state generator sub-creator for quantum-selected configuration interaction.

Classes

SubspaceStateGeneratorSubCreator

Creator for setting a subspace state generator on a parent creator.

class SubspaceStateGeneratorSubCreator

Bases: Generic[T]

Creator for setting a subspace state generator on a parent creator.

__init__(parent: T, field_name: str) None

Initialize the subspace state generator creator.

Parameters:
  • parent (T) – The parent creator to which the subspace state generator will be assigned.

  • field_name (str) – The name of the field in the parent creator.

Return type:

None

identity() T

Generate identity subspace states as circuits for quantum-selected configuration interaction.

Generate the identity subspace state circuit, which is simply the reference circuit itself.

Return type:

T

krylov_qdrift(*, maximum_krylov_order: int = 3, time_step: float = 1.0, number_of_randomizations: int = 1, qdrift_subsequence_length: int = 8) T

Generate Krylov subspace states as circuits for quantum-selected configuration interaction.

For each Krylov order \(k = 1, \ldots, d\) (with \(d\) the maximum order) this generator produces a circuit preparing (an approximation of) the Krylov vector.

\[\ket{\Psi_k} = e^{-iH k \tau} \ket{\Psi_\text{ref}} ,\]

where \(\tau\) is the time step and \(\ket{\Psi_\text{ref}}\) is prepared by the reference circuit. Each time-evolution operator \(e^{-iH k \tau}\) is approximated by the qDRIFT randomized compiler with the given settings.

This is done for each randomization, producing a total of \(d \cdot r\) circuits, where \(r\) is the number of randomizations.

Parameters:
  • maximum_krylov_order (int) – The largest Krylov order \(d\); circuits are generated for every order \(k = 1, \ldots, d\).

  • time_step (float) – The reference time step \(\tau\); the evolution time for order \(k\) is \(k \tau\).

  • number_of_randomizations (int) – Number of circuits generated per Krylov order.

  • qdrift_subsequence_length (int) – Number of Hamiltonian terms sampled into each qDRIFT time-evolution circuit, i.e. the length (gate count) of the qDRIFT subsequence. Bigger values reduce the qDRIFT sampling error but increase the circuit depth.

Return type:

T