Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
The notebook implements the core block of the algorithm described in https://arxiv.org/pdf/2011.03494

Variables 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 each QStruct 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
Conceptually, ELL corresponds to the LCU registers used in:
  • the prepare oracle.
  • the select oracle.
It does not represent the physical system itself, but rather the algorithmic machinery required to construct the qubitized quantum walk.

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 select oracle
This register corresponds directly to the fermionic system register on which operators such as ZZ, number operators, and basis rotations act. The additional auxiliary qubits (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.
Together, these registers are the variables of the block-encoded Hamiltonian and quantum walk construction described in the article.

Helper functions

Prepare

  • Part 1
Prepare 1
Output:

Prepare

  • Part 2
prepare_2
Output:

Prepare summary

Select

select
Output:

Walk Operator

walk

Repeated Walk with Recursion

Output:
Output:
Output: