QuantumMAMBO provides structures for many-body objects in quantum computing. They can all be seen in src/UTILS/structures.jl
. In particular, it provides the fermionic operators F_OP
specially geared towards two-electron number-conserving operators, Q_OP
for qubit operators, and M_OP
for Majorana operators coming from fermionic operators. All operators and unitaries have structured classes, which in the future will be used for efficient compilation of quantum circuits and resource estimates.
QuantumMAMBO.jl
includes efficient implementations for fermionic and qubit operators. To obtain results shown in Ref.(1), run on a terminal (e.g. for LiH):
julia L1.jl lih
All options and tolerances can be seen in src/config.jl
. By default, QuantumMAMBO.jl
will use the package PythonCall
for calling Python, installing all necessary Python packages on a fresh conda environment using MicroMamba
. Change the PY_ENV
variable in src/config.jl
to "Null"
for using local Python enviornment instead. There are three ways in which QuantumMAMBO can be used, which are now decribed.
Using Julia's package manager, add the QuantumMAMBO
package. Can either be done by typing ]
on the Julia REPL, followed by add QuantumMAMBO
, or by running the following lines:
import Pkg
Pkg.add("QuantumMAMBO")
For development, this repository can be cloned and called from a Julia session in the directory with the commands:
import Pkg
Pkg.activate("./")
Pkg.instantiate()
using QuantumMAMBO
This allows for changes to be done in the package and tried out before creating a pull request for uploading a new version of the package.
For using QuantumMAMBO from a Python session, the juliacall
Python package is required, which can be installed with pip install juliacall
. Once installed, QuantumMAMBO can be installed on Python as:
import juliacall
from juliacall import Main as jl
jl.seval('import Pkg')
jl.seval('Pkg.add("QuantumMAMBO")')
Once installed, it can be imported as a Python module by running:
import juliacall
from juliacall import Main as jl
jl.seval("using QuantumMAMBO")
QM = jl.QuantumMAMBO
See pyMAMBO.py
for an example script of interfacing Python with QuantumMAMBO. QuantumMAMBO can also be called from a local installation for Python by instead using the following script:
import juliacall
from juliacall import Main as jl
jl.seval('import Pkg; Pkg.activate("./")')
jl.seval('Pkg.instantiate()')
jl.seval("using .QuantumMAMBO")
QM = jl.QuantumMAMBO
L1.jl
: full workflow for obtaining LCU 1-norms for all decompositions/methodsLCU.jl
: workflow for obtaining circuits of LCUs using cirq-ftProject.toml
: package metadata and dependenciesCondaPkg.toml
: python installation dependencies for micromamba environmentpyMAMBO.py
: example of python script using QuantumMAMBO
config.jl
: general parameters and settings for all functionsQuantumMAMBO.jl
: wrapper for the module, includes all necessary filesUTILS folder
: contains all functions
bliss.jl
: functions for BLISS routine (see Ref. 2)circuits.jl
: julia wrappers for interfacing QuantumMAMBO LCU decompositions with cirq circuit buildingcircuits.py
: python wrapper which includes all cirq building tools in cirq foldercirq
: folder containing all python functions for building cirq LCU oraclescost.jl
: functions for calculating different norms of operators. Mainly 1- and 2-norms of fermionic operators.decompose.jl
: CSA, DF, and related decompositions of fermionic operatorsferm_utils.py
: utilities for fermionic operators in python, interfaces with openfermionfermionic.jl
: utilities for QuantumMAMBO fermionic operators class (F_OP, defined in structures.jl)gradient.jl
: gradients for CSA and CSA_SD optimizationsguesses.jl
: initial guesses for decomposition routinesham_utils.py
: python utilities for the electronic structure Hamiltonian, interfaces with openfermionlcu.jl
: calculation of lcu 1-norms for different decompositionslinprog.jl
: linear programming routines for symmetry-shift optimization (see Refs. 1 and 2, corresponds to "partial" routine in Ref. 2)majorana.jl
: utilities for QuantumMAMBO Majorana operators class (M_OP, defined in structures.jl)orbitals.jl
: orbital optimization routine for 1-norm minimization (see Koridon et al., Phys. Rev. Res. 3 (3), 2021. Material is also covered in Refs. 1 and 2)parallel.jl
: code with parallel capabilities, mainly for trotter bounds (under construction)planted.jl
: routines for obtaining planted solutions for a given Hamiltonianprojectors.jl
: builds projectors of Fock space into constant number of electrons subspace, useful for Trotter bounds (under progress)py_qubits.jl
: python utilities for qubit operators, interfaces with openfermionpy_utils.jl
: julia interface to all python modules and openfermionqubit.jl
: utilities for QuantumMAMBO qubit operators class (Q_OP, defined in structures.jl)saving.jl
: save-load utilities for decompositions and optimization results, uses HDF5structures.jl
: definition of classes for many-body operatorssymmetries.jl
: building of symmetry operators, e.g. Sz, Nesymplectic.jl
: utilities for representing and manipulating qubit space as symplectic vectorstrotter.jl
: Trotterization implementation, errors and bounds (under construction)unitaries.jl
: unitary transformations related to fermionic QuantumMAMBO operators (i.e. F_OP)wrappers.jl
: runner functions which run workflows for obtaining all necessary quantities for e.g. tables in Refs. 1 and 2
This code was developped and used for all results in the publications:
[1] I. Loaiza, A. Marefat Khah, N. Wiebe, and A. F. Izmaylov, Reducing molecular electronic Hamiltonian simulation cost for Linear Combination of Unitaries approaches. Quantum Sci. Technol. 8 (3) 035019, 2023.
[2] I. Loaiza, A. F. Izmaylov, Block-Invariant Symmetry Shift: Preprocessing technique for second-quantized Hamiltonians to improve their decompositions to Linear Combination of Unitaries. arXiv:2304.13772, 2023.
- Ignacio Loaiza (@iloaiza)
- Aritra Brahmachari (@AritraBrahmachari)
- Joshua T. Cantin (@jtcantin)
- Linjun Wang (@Zephrous5747): author of module_sdstate