frontend module
Module contents (__init___.py)
- class frontend.AdiabaticProgram(H_init: ExpressionBase, H_final: ExpressionBase, total_time: float, time_steps: int, num_all: int)
Bases:
objectThe adiabatic program stores the required data for AQC. It should be returned from Frontend after converted, and then passed to the Backend to run as adiabatic.
- Parameters:
H_init (ExpressionBase) – The language expression of the initial Hamiltonian.
H_final (ExpressionBase) – The language expression of the final Hamiltonian.
total_time (float) – The running time for the AQC.
time_steps (int) – The number of time steps.
num_all (int) – The number of all qubits, including both state and clock qubits.
- compile() tuple[spmatrix, spmatrix]
Compile the language expression of the Hamiltonians.
- Returns:
The compiled Hamiltonians.
- Return type:
tuple[sp.spmatrix, sp.spmatrix]
- class frontend.Frontend
Bases:
objectFrontend is where the real translation happens. It is the implementation of the proposed translation of the papers we found.
- unitaries_to_program(Us: list[spmatrix]) AdiabaticProgram
Translate a list of unitaries into an adiabatic program.
- Parameters:
Us (list[sp.spmatrix]) – list of unitaries.
- Returns:
The adiabatic program.
- Return type: