qdk_chemistry.algorithms.state_preparation package
QDK/Chemistry state preparation algorithms module.
This module provides quantum state preparation algorithms for preparing quantum states from classical wavefunctions.
- class qdk_chemistry.algorithms.state_preparation.SparseIsometryGF2XStatePreparation
Bases:
StatePreparationState preparation using sparse isometry with enhanced GF2+X elimination.
This class implements “GF2+X” state preparation for electronic structure problems using the
gf2x_with_trackingfunction which performs smart preprocessing before GF2 Gaussian elimination. The preprocessing includes:Removing duplicate rows using CNOT operations
Removing all-ones rows using X operations
Then performing standard GF2 Gaussian elimination
Apply the additional rank reduction if the reduced row-echelon matrix is diagonal
This enhanced approach can be more efficient than standard GF2 Gaussian elimination, particularly for matrices with duplicate rows or all-ones rows. The algorithm tracks both CNOT and X operations for proper circuit reconstruction.
The algorithm:
Reads the wavefunction to get coefficients and bitstrings
Converts bitstrings to a binary matrix
Applies enhanced GF2+X elimination (duplicate removal + all-ones removal + GF2)
Performs dense state preparation on the reduced space
Applies recorded operations (both CNOT and X) in reverse order to expand back to full space
Key References:
Sparse isometry: Malvetti, Iten, and Colbeck (arXiv:2006.00016) [MIC21]
- __init__()
Initialize the SparseIsometryGF2XStatePreparation.
- class qdk_chemistry.algorithms.state_preparation.StatePreparationFactory
Bases:
AlgorithmFactoryFactory class for creating StatePreparation instances.
- __init__()
Initialize the StatePreparationFactory.
- class qdk_chemistry.algorithms.state_preparation.StatePreparationSettings
Bases:
SettingsSettings for state preparation algorithms.
- __init__()
Initialize the StatePreparationSettings.