View on GitHub
Open this notebook in GitHub to run it yourself
Even more efficient quantum computations of chemistry through tensor hypercontraction
The notebook implements the core block of the algorithm described in https://arxiv.org/pdf/2011.03494Variables Definition
This section defines the variables used in the preprocessing code.All theoretical motivation, physical meaning, and algorithmic justification are given in the reference article; here, we only document the role of each variable in the code.
Resolution and spin parameters
-
N_EPSILON
Number of qubits used to represent the quantum number resolution of the result.
Controls numerical precision in state preparation and phase-dependent quantities. -
N_UD
Number of spin-orbitals per spin sector (up/down).
Randomized preprocessing data
The following variables are randomly generated placeholders with the correct shapes and bit-widths required by the algorithm:-
R_BR
Random rotation angle used in state preparation. -
MU_ALT,NU_ALT
Boolean tables encoding alternate auxiliary indices. -
KEEP
Boolean table encoding keep / discard decisions for coherent alias sampling. -
THETA
Boolean array encoding sign or phase information. -
ROT_MU,ROT_NU
Boolean tables encoding rotation data for auxiliary indicesμandν.
Precomputed amplitude data
SINE_AMPLITUDES
Discrete sine amplitude table used for state preparation.
Length:2**n_t.
Note
- All numerical values are synthetic and used only to validate register sizing, indexing, and data flow.
High-Level Role of the Quantum Registers
This section explains the conceptual role of eachQStruct in the context of the algorithm described in the article.
ELL — Control and State-Preparation Register
ELL groups all registers used to index Hamiltonian terms, prepare amplitudes, and control conditional operations in the linear-combination-of-unitaries (LCU) / qubitization framework.
At a high level, this register:
- Encodes auxiliary indices (
μ,ν) labeling terms in the Hamiltonian expansion - Stores temporary control and success flags used during preparation and uncomputation
- Holds auxiliary data needed for phase, sign, and rotation selection
ELL corresponds to the LCU registers used in:
- the
prepareoracle. - the
selectoracle.
PSI — System (Fermionic State) Register
PSI represents the quantum state of the simulated fermionic system.
At a high level, this register:
- Encodes the occupation of spin-orbitals for both spin sectors (up and down).
- Stores the many-body electronic state on which the Hamiltonian acts
- Serves as the target of controlled operations generated by the
selectoracle
plus1, plus2) are used to control superpositions over spin components.
Summary
-
ELL:
Algorithmic control, indexing, and state-preparation workspace for qubitization. -
PSI:
Physical system register representing the fermionic many-body state.
Helper functions
Prepare
- Part 1

Output:
Prepare
- Part 2

Output:
Prepare summary
Select

Output:
Walk Operator

Repeated Walk with Recursion
Output:
Output:
Output: