Quantum Computing¶
On this page we are going to present you the quantum computing methods we have developed and made available through our SDK:
-
A mapping and measurement method for electronic structure problem formulations 1
-
A tensor networks based methodology to optimize an Hamiltonian for generating an optimized Hamiltonian to be solved on a classical computer (CPU, GPU) while at the same time generating an improved state with a quantum circuit (Ansatz) to be solved on a QPU. 2
-
Zero-noise extrapolation
-
Quantum circuit generation methods such as our genetic evolution method in our Xenakis package
-
Our open-source benchmarking framework to test different variational quantum algorithms (VQA) such as VQE, QAOA etc. and other methods (QSE, GQE, CP-SAT).
-
Our research articles and research projects
A Cebule SDK task can be run in the following way:
# Import needed packages
from dotenv import load_dotenv
import json
import mqsdk
from mqsdk.core.cebule import TaskType
import os
# Initialize the SDK with user credentials
load_dotenv()
session = mqsdk.Cebule(os.environ['EMAIL'], os.environ['PASSWORD'])
# The input data specific to the individual task types
input_data = '''
{
"geometry": [
0.0, 0.0, -0.068,
0.0, -0.791, 0.544,
0.0, 0.791, 0.544
],
"symbols": ["O", "H", "H"],
...
...
}
'''
# Run a task via Cebule SDK on the Cebule HPC
task = session.cebule.create_task("Your title for the specific task run", TaskType.MOL_MAP, input_data)
For more information about the Cebule SDK: https://gitlab.com/mqsdk/python-sdk
Mapping and measurement of electronic structure problems via gate-based quantum circuits¶

Mapping method¶
Purpose
The mapping method creates a custom encoding of molecular electronic states onto quantum hardware that respects problem constraints (such as fixed electron number and spin multiplicity) while using fewer qubits than standard encodings like Jordan-Wigner.
Key Features
- Reduced Qubit Requirements: Constraint-based mapping significantly decreases the number of qubits needed to represent molecular systems
- Efficient Measurements: Novel measurement scheme reduces circuit complexity for Hamiltonian expectation value estimation
- No Approximations: Methods preserve the full physics of the quantum chemistry problem
- Classical Preprocessing: Resource-intensive calculations performed classically, executed only once per problem
Benefits
- Automatic Constraint Enforcement: VQE optimization is confined to physically valid states
- Faster Convergence: Smaller search space leads to more efficient optimization
- Hardware Efficiency: Fewer qubits required, especially beneficial for larger basis sets
- Exact Results: No approximations to the underlying physics
How It Works
-
Define Constraints: Specify physical constraints for your molecular system:
-
Number of electrons (typically matching nuclear charge for neutral molecules)
- Spin multiplicity (singlet, doublet, triplet, etc.)
-
Spatial symmetries (optional)
-
Identify Valid States: The method identifies the subspace of Fock space states that satisfy all constraints. For N spin orbitals and M valid states satisfying constraints, only \(\log_2(M)\) qubits are needed instead of N qubits.
- Generate Custom Mapping: A bijective mapping operator D is constructed that maps the valid subspace to computational basis states on the quantum computer.
- Transform Hamiltonian: The molecular Hamiltonian is transformed to operate in the reduced Hilbert space: \(H_H= D H D^{\dagger}\)

TaskType: mol_map
- Inputs
geometry: array 1-d, list Geometry of molecule
symbols: array 1-d, list Element symbol (letters) for each atom in the geometry and in sequence how defined in the geometry. E.g. symbol for hydrogen is "H" for iron thek symbol is "Fe".
basis: string Basis set definition (Default: "sto3g")
multiplicity: value Spin multiplicity enforced by projection of the determinant wavefunction. E.g., a singlet state has value 1 and a triplet state the value 3. The ground state of most molecules is a singlet state (value of 1).
charge: value Total charge of the molecule.
- Output
mapped_hamiltonian: array 2-d, list (float) The mapped Hamiltonian in sparse format. Each element has a list defining the row, column and value of each element in the Hamiltonian matrix.
hf_state: list (int) The Hartree Fock ground state in the new basis.
mapping_matrix: array 2-d, list (float) The mapping matrix \(D\) generated from the molecular Hamiltonian (Hilbert space). The matrix is a mapping from the Hilbert space to the subspace in sparse format. Each element has a list defines the row, column and value of each element in the mapping matrix \(D\).
Measurement method¶
Purpose
The measurement method efficiently evaluates the expectation value of the mapped Hamiltonian using a novel circuit generation scheme that groups terms by computational basis state pairs rather than Pauli string decomposition.
How it works
Express Hamiltonian in Basis States: The Hamiltonian is written as:
where \(\lvert m \rangle\) and \(\lvert m' \rangle\) are computational basis states.
Partition Terms: Terms are divided into two groups:
Diagonal terms (\(m = m'\)): Measured directly in computational basis Off-diagonal terms (\(m \neq m'\)): Require basis rotation circuits
Generate Measurement Circuits: For off-diagonal terms, circuits are grouped by which qubits differ between \(\lvert m \rangle\) and \(\lvert m' \rangle\):
Terms with the same "active qubits" are measured simultaneously Each group requires one Hadamard gate and CNOT gates Maximum of \(2M\) circuits needed (where \(M\) is dimension of mapped space)
Extract Expectation Values: Measurement probabilities combined with Hamiltonian coefficients yield \(\langle H \rangle\)
Benefits
- Fewer Unique Circuits: Typically requires fewer measurement circuits than Pauli string grouping methods
- Simultaneous Measurements: Multiple Hamiltonian terms measured per circuit
- Hardware Flexibility: Circuit topology can be adapted to quantum device connectivity
- Shallow Circuits: Measurement circuits have low depth, reducing decoherence effects
TaskType: qasm_gen
- Inputs
operator: array 2-d, list (float or int) The operator to be measured in sparse matrix format. The operator needs to be real valued and Hermitian. Each element should be a list defining the row, column and value of each element in the operator matrix.
- Optional Inputs
state_vector: array 1-d, list (float or in) A vector defining the state the operator should be measured in, such as the HF ground state. (Default behavior: no initial_state circuit generated) (default: None)
state_circuit: str/openQASM file The circuit defining the state for the expectation value measurement. (default: None)
include_state_circuit: bool Logical argument determining whether the generated qasm circuits should include the state preparation or not. If True, either state_circuit or state_vector needs to be defined. (default: False)
- Output
circuit_files: list (str) List of strings defining all circuits to be measured, in openQASM 2.0 format. If include_state_circuit was set to True, these circuits contain the combined state and measurement circuits. Ordered by circuit number.
postprocessing_instructions: array 2-d, list (float) The data needed to post-process the measurement results to arrive at the expectation value. The first index refers to the circuit number and the second to the qubit in the circuit.
To get the final expectation value with M=postprocessing_instructions:
- For each circuit in circuit_files, measure the occupation probability of each qubit.
- Create a matrix P, where P[i,j] is the probability of the i'th qubit of the j'th circuit.
- Matrix multiply M and P, and take the trace: (M@P).trace()
state_circuit: str Only available if state_vector input was defined. Circuit instructions for preparing the state defined in state_vector OpenQASM 2.0 format.
Combining the mapping and measurement methods¶
Combined Performance
When used together, the mapping and measurement methods provide synergistic benefits:
| Molecule | Basis | Qubits (JW) | Qubits (Mapped) | Pauli Terms | Measurement Circuits |
|---|---|---|---|---|---|
| H2 | STO-3G | 4 | 2 | 14 | 2 |
| LiH | STO-3G | 12 | 8 | 630 | 25 |
| H2O | STO-3G | 14 | 9 | 1085 | 512 |
| BeH2 | STO-3G | 14 | 11 | 665 | 1943 |
| CH4 | STO-3G | 18 | 14 | 9260 | 16384 |
The number of measurement circuits after mapping approaches the theoretical maximum of \(2^Q\) where \(Q\) is the number of qubits after mapping, indicating the mapped Hamiltonians encode information efficiently.
The following table shows the qubit requirements for water with respect to different basis sets and frozen orbitals:

Efficient quantum computing with parameterized tensor networks as matrix product states (MPS) and operators (MPO)¶
Tensor networks have shown that they can be applied to encode quantum chemistry problems in a highly efficient way to apply calculation routines for various molecular properties.
The TN-VQE method depicted in our paper 2 was the starting point for us to develop a tensor network based approach to leverage classical computing to perform as much computational effort for a quantum chemistry calculation as possible to only make the most crucial calculation run on a QPU.
The Tensor Network-Assisted Variational Quantum Eigensolver (TN-VQE) is a hybrid quantum-classical algorithm that combines the strengths of tensor network methods with the Variational Quantum Eigensolver (VQE) to improve convergence and accuracy when finding ground state energies of quantum systems. The tensor network construction can be separated from the specific quantum algorithm (VQE) and one can combine the generated Hamiltonian in different ways with other algorithms.

Purpose
Traditional VQE algorithms face several challenges on current NISQ (Noisy Intermediate-Scale Quantum) devices:
- Barren plateaus: Optimization landscapes where gradients vanish, causing the algorithm to stall
- Initialization sensitivity: Poor choice of initial parameters can prevent convergence
- Shallow circuit limitations: NISQ devices require shallow circuits, limiting expressiveness
TN-VQE addresses these challenges by incorporating parameterized tensor networks to better represent the quantum many-body system before the quantum circuit optimization.
Benefits
- Improved convergence: TN-VQE demonstrates better convergence compared to randomly-initialized quantum circuits, particularly for circuits with fewer layers where standard VQE often fails to converge.
- Reduced circuit depth: The tensor network assists the quantum circuit by better encapsulating the complexity of quantum many-body systems, allowing accurate results with shallower circuit depths suitable for NISQ devices.
- Better gradient properties: The TN-VQE approach exhibits smaller gradient magnitudes during optimization, suggesting: More efficient parameter updates, a smoother optimization landscape and reduced sensitivity to noise in quantum simulations.

How It Works
The TN-VQE splits the optimization task between a classical tensor network and a quantum circuit. The minimization problem becomes:
where:
- \(U(\theta)\): Parameterized unitary tensor network (classical)
- \(U(\phi)\): Parameterized quantum circuit (quantum)
- \(H\): Problem Hamiltonian
-
\(\theta, \phi\): Parameters optimized simultaneously
-
Hamiltonian representation: The system Hamiltonian is encoded as a Matrix Product Operator (MPO).
- Unitary tensor network: A parameterized classical tensor network \(U(\theta)\) wraps around the Hamiltonian, improving its representation. Quantum circuit: A standard parameterized quantum circuit \(U(\phi)\) prepares quantum states.
- Joint optimization: Both \(\theta\) and \(\phi\) are optimized simultaneously using gradient descent.
TaskType: tn_qc_opt
- Inputs:
h_coeff_values: 1-d array (floats), list The coefficients of the Hamiltonian
h_operators: List The operators defining the Hamiltonian, the order should correspond to h_coeff_values. Can be in four forms:
fermionic operators: List (tuples)Each Hamiltonian term (consisting of a string of fermionic creation and/or annihilation operators) is represented by a tuple of 2-tuples (each 2-tuple representing an operator). The first element of the 2-tuple is an integer, representing the site the operator acts on. The second element is a boolean: True (or 1) represents a creation operator, False (or 0) represent an annihilation operator See OpenFermion (https://quantumai.google/openfermion/tutorials/intro_to_openfermion) Example: \(a_4^\dagger a_2 a_1\) = ((4,1),(2,0),(1,0)) or ((4,True),(2,False),(1,False))qubit operators: List (tuples)Each Hamiltonian term (consisting of a string of single qubit pauli operators) is represented by a tuple of 2-tuples (each 2-tuple representing an operator). The first element of the 2-tuple is an integer, representing the site/qubit the operator acts on. The second term is a string denoting the type of operator ('X', 'Y' or 'Z'). See OpenFermion Example: \(\sigma_0^x \sigma_1^y \sigma_3^z\) = ((0,'X'),(1,'Y'),(3,'Z'))qubit operators: List (strings)Each string represents a term, where each operator is denoted by the corresponding letter ('X', 'Y' or 'Z') followed by an integer represeting the site/qubit it acts on. The operators should be seperated by a space. Example: \(\sigma_0^x \sigma_1^y \sigma_3^z\) = "X0 Y1 Z3"-
Pauli strings: List (strings)Each string represents a qubit operator term in the format of a Pauli string. Each string defines the pauli operator for each qubit ('I', 'X', 'Y' or 'Z'), and are of the length of the total number of qubits. The string is read the way Qiskit reads one, i.e. right to left: the rightmost character is qubit 0 and the leftmost the highest-numbered qubit, so a string means here what it means handed toSparsePauliOp. Example: \(\sigma_0^x \sigma_1^y \sigma_3^z\) = 'ZIYX' -
Optional Inputs:
n_layers_network: int Number of layers for the classical tensor network, parametarized by theta. (Default: 1)
qasm_ansatz: string OpenQASM 3.0 circuit ansatz as a parameterized quantum circuit, with its free parameters declared as input arrays. It is parsed with qiskit.qasm3.loads on every backend, so the same string is accepted whether the backend is a Qiskit or a Pennylane one, and the number of qubits it declares must match the number of qubits of the Hamiltonian.
(Default on both Qiskit and Pennylane backends: qiskit's n_local circuit with Rz Ry Rz rotations and Cx entanglement with 'sca' connectivity. On Pennylane backends, the circuit is built gate by gate, so a given phi means the same state on either platform.)
The circuit is read with Qiskit's qubit ordering on every backend: q[i] of the QASM circuit is the qubit that index \(i\) of the Hamiltonian operators refers to. The same convention holds whether the backend is a Qiskit or a Pennylane one, and for both measurement methods, so the same QASM string gives the same energy everywhere.
n_layers_circuit: int If using the default ansatz circuit: Number of entanglement layers in the quantum circuit (parametarized by phi). A rotation layer both opens and closes the circuit, so there are n_layers_circuit + 1 of them and phi holds (n_layers_circuit + 1) * n_qubits * 3 parameters.
(Default: 3. Only relevant if qasm_ansatz is None.)
tn_ansatz: str Which family of two-qubit gates the M tensors of the tensor network \(U(\theta)\) are drawn from. This sets both what \(U(\theta)\) can represent and how many parameters per node theta holds. (Default: 'rotation_3param')
'rotation_1param'A real rotation applied to each of the two wires, 1 parameter per node. Because the gate factorises across the wires, a network of these cannot entangle: it only changes the local basis of each qubit.'rotation_3param'The most general single-qubit rotation applied to each of the two wires, 3 parameters per node. Also non-entangling.'givens'A Givens rotation mixing the two wires, 1 parameter per node. Under the Jordan-Wigner encoding of adjacent spin-orbitals this is a single-particle (orbital) basis rotation: it entangles, it conserves particle number, and \(U^\dagger H U\) stays a two-body fermionic Hamiltonian, so its Pauli-string count saturates instead of growing with the number of layers.'number_preserving'The most general number-preserving two-qubit gate (an arbitrary U(2) on the singly-occupied subspace plus a free phase on each of the empty and doubly-occupied states), 5 parameters per node. A strict superset of'givens', but not a single-particle transformation, so \(U^\dagger H U\) picks up higher-body terms and many more Pauli strings. Use it when the Givens family is too rigid and the extra measurement cost is affordable.
three_para_tn: bool Deprecated, superseded by tn_ansatz. Task inputs written before the families were named are still accepted: True selects 'rotation_3param' and False selects 'rotation_1param'. Only checked if tn_ansatz is not given.
theta_init: array Initial guess for theta parameters (defining the tensor network). Its shape depends on tn_ansatz through the number of parameters per node listed above, and on n_layers_network. When a mapping_matrix is given together with tn_ansatz: 'givens', theta parametrizes an orbital rotation on the spatial orbitals instead of a network over the qubits, so it is the smaller shape that rotation needs. (Default: zeros)
phi_init: array Initial guess for phi parameters (defining the quantum circuit ). (Default: random)
conv_tol: float Convergence tolerance, handed to scipy.optimize.minimize as tol. (Default: 1e-6)
opt_method: str Optimization solver method. Every method accepted as method by scipy.optimize.minimize can be named here, plus two solvers this task supplies itself, written for the way a VQE cost function behaves on a device. Names are matched case-insensitively. (Default: "COBYLA")
'SPSA'Simultaneous perturbation stochastic approximation. It estimates the gradient from two evaluations however many parameters there are, by perturbing all of them at once along a random direction, so a step costs two measurements rather than one per parameter. That is what recommends it on hardware and for large parameter counts: COBYLA needs one evaluation per parameter plus two before it can move at all. The price is noisy steps; the step gain is calibrated against the gradient the problem actually has before the run starts, rather than guessed.'ExcitationSolve'Coordinate-wise exact minimization, after ExcitationSolve. Along any one parameter the energy is a trigonometric polynomial of known frequencies, so a handful of evaluations determines the whole one-dimensional landscape and the parameter can be set to its exact global optimum instead of nudged towards it. The optimizer sweeps the parameters, placing each in turn, and ends every sweep on a measured energy.
Both are passed to scipy as custom methods, so n_iterations, conv_tol and opt_options reach them the same way they reach scipy's own methods.
n_iterations: int Number of maximum iterations for optimization. Note that some optimization solvers perform several function calls per iteration. (Default: None, which leaves the iteration budget to the solver's own default)
What an iteration costs differs by solver: COBYLA reads the budget as a count of function evaluations rather than iterations; an SPSA iteration is two evaluations, plus a one-off gain calibration and a closing measurement; and an ExcitationSolve iteration is a full sweep over the parameters, costing 1 + 2 * (number of frequencies) evaluations for each parameter it varies, plus one at the point the sweep reached.
COBYLA also has a floor: it needs one more evaluation than the number of parameters it varies to build its initial simplex. A budget below that is rejected with an error naming the minimum, rather than being silently raised by scipy, so a run always uses the budget the input asked for. Only the parameters the chosen optimization_mode varies are counted.
opt_options: dict Further options handed straight to the options argument of scipy.optimize.minimize, so the accepted keys are the ones the chosen opt_method documents (e.g. rhobeg for COBYLA, gtol for BFGS). Entries here override the defaults the task sets, including the maxiter that n_iterations fills in.
The two solvers above take their own keys here. Neither needs any of them set; the defaults are chosen for the circuits this task builds.
For 'SPSA':
c: floatSize of the perturbation the gradient estimate divides by. Set it near the standard deviation of the noise on the objective: acbelow the noise amplifies it instead of measuring a slope. The default is sized for an exact simulation; a task that namesn_shotsgets 0.2 instead, since the run is then shot-based.a: floatStep gain. Measured from the problem before the run when omitted, which is what keeps the steps from diverging.target_step: floatHow far the first iteration should move a parameter, which is what the gain is calibrated to. Lower it if the optimum is nearer than a step — a UCCSD ansatz started at Hartree-Fock is the case to watch, since every step then lands past the optimum and the run ends where it began, with a warning saying so. (Default: 0.1)alpha,gamma,stability: Decay exponents and the damping term of the step schedule \(a / (k + A)^\alpha\).seed: intSeeds the perturbation directions, so a run repeats.n_final_samples: intRepeats of the closing evaluation at each candidate point. Averaging them sharpens the energy reported, and their scatter sizes the margin the candidates are compared by. Set it to 1 for an exact objective.
For 'ExcitationSolve':
frequenciesThe frequencies the energy carries in each parameter. By default they are measured per parameter, on a noiseless statevector rather than by scanning the run's own objective, so the measurement costs no shots and no QPU time and is not confused by shot noise; the sets come back onOptimizeResult, and passing them in on a later run skips the measuring. Pass a single sequence to state one set for the circuit parameters instead (theta's then come from the M gates, exactly), or a per-parameter list, whoseNoneentries are measured. A set has to contain the frequencies the energy really carries — fitting a landscape the energy does not have places the parameter at the minimum of the wrong function — so stating them is worth it only for a circuit whose generators you know. A run too large to simulate falls back on the gate-derived sets with a warning.samples: intEvaluations per parameter fit. The default is exactly the number of unknowns, which leaves nothing over to average noise with; a noisy objective wants more.tol: floatStop when a whole sweep improves the energy by less than this.validate: bool,validate_rtol: float,validate_atol: floatOn the first sweep, check the fit's claimed energy against what the objective gives where it placed the parameter, which is what turns a wrong frequency set from a silently wrong answer into a warning naming the parameter. A point that disagrees is re-measured a few times to size the objective's noise there (validate_repeats), and the warning is raised only pastvalidate_sigmasstandard deviations of it, so shot noise alone does not trip it. Shot noise is absolute, sovalidate_atolis the tolerance to size to it.check_flat: boolLook for parameters the energy does not depend on at all, so no fit is spent moving them at random. A circuit's leading Z rotation acting on \(\lvert 0\ldots0 \rangle\) is one, being a global phase. Skipped when every frequency set was measured, since the measurement finds them already.
n_shots: int Number of measurement shots per circuit or per expectation value. The default is None, which leaves the shot count to the backend: Pennylane simulators then evaluate expectation values analytically (exactly), and Qiskit backends fall back on the estimator's own default.
backend: str: Definition of which device or simulator/emulator should run the quantum circuit. Supported backends through both Qiskit and Pennylane. Currently accepted inputs (Default: "default.qubit", a Pennylane simulator):
- Qiskit simulators: 'qasm_simulator', 'statevector_simulator', 'unitary_simulator', 'aer_simulator'
- Qiskit IBM hardware: (ibm_NAME, e.g. ibm_berlin) or fake IBM backends (fake_NAME, e.g. fake_manila)
- Pennylane simulators: 'default.qubit', 'lightning.qubit', 'default.mixed', 'default.tensor'
An ibm_* backend is real quantum hardware and needs use_qpu_time set as well; without it the task refuses the backend before it reaches IBM. The fake backends carry a device's noise model and connectivity without using QPU time, so they need nothing.
use_qpu_time: bool Allow a backend that is real quantum hardware, which costs QPU time. Only a literal true counts. (Default: false)
measurement_method: str Can be 'pauli' or 'grouped'. Defines whether the evaluation of quantum expectation values of H are done by decomposing H into Pauli strings which are then measured ('pauli', the traditional way), or whether a MQS patented measurement scheme (described here) is used ('grouped'). (Default: 'grouped')
'grouped' needs at most \(2^{Q+1}\) circuits per evaluation however dense the transformed Hamiltonian is, while 'pauli' needs one per qubit-wise commuting group, which grows with the term count; it needed fewer circuits in every case measured. Two things recommend 'pauli' instead:
- Its basis changes are single-qubit gates, where 'grouped' uses CNOTs. On hardware that is two-qubit gate error in every measurement circuit.
- It measures the Hamiltonian as Pauli terms, where 'grouped' needs the dense \(2^Q\) operator. For a Givens run without a mapping matrix that means rebuilding that operator on every evaluation instead of taking the cheaper orbital route, and \(16 \cdot 4^Q\) bytes of memory: 268 MB at 12 qubits, 4.3 GB at 14.
With 'pauli' on a Pennylane backend, a transformed Hamiltonian of more than 5000 terms is measured ungrouped rather than grouped by commutation, with a warning: the grouping compares every pair of terms, so its memory grows with the square of the count. A run that reaches that point is usually better off with 'grouped'.
readout_mitigation: str Correct readout error in what the circuits measure. The only method is 'tensored', which models each measured physical qubit's readout as an independent bit flip — read 1 when prepared in 0 with probability \(p_{01}\), read 0 when prepared in 1 with \(p_{10}\) — calibrates both rates once per run with two circuits, and inverts them out of what is measured. Needs a Qiskit backend; a Pennylane one has no readout to correct. (Default: None)
Under a readout-only noise model on a 4-qubit test Hamiltonian this brings all four Qiskit cost functions from 0.07-0.08 Hartree off the exact energy to within shot noise. It is not free: with 'grouped' the correction is applied to the measured bitstring probabilities and costs little, while with 'pauli' each Pauli's sub-strings have to be measured alongside it, which on a fake 16-qubit device cost about 1.6x the evaluation time against 1.1x for 'grouped'. IBM hardware's estimator already corrects readout itself by default, so a run that sets this turns that off rather than correct the error twice.
estimator_options: dict Options for the Qiskit EstimatorV2 that runs the 'pauli' measurement method, in the form qiskit-ibm-runtime documents. Refused where no estimator runs — the 'grouped' method and every Pennylane backend — rather than silently ignored, and refused when its default_shots contradicts n_shots, or when it turns on the estimator's own readout mitigation while readout_mitigation is also set. (Default: None)
optimization_mode: str: Can be 'circuit', 'network' or 'both'. Decides which parameters are optimized: 'circuit' refers to regular VQE, where theta_init is taken to be the fixed values of the tensor network parameters while phi is varied; 'network' optimizes only the tensor network parameters theta, while phi_init is used to define the fixed quantum circuit (no quantum measurements are made in this mode); and 'both' optimizes both the quantum circuit parameters (phi) and the tensor network parameters (theta) simultaneously. (Default: 'both')
mapping_matrix: array 2-d, list (float) The mapping matrix \(D\) produced by the mapping method (mol_map), in the same sparse "row, column, value" format that task outputs it in. Supplying it tells the task that the Hamiltonian in h_coeff_values/h_operators is a mapped one, i.e. that its qubits index configurations rather than spin-orbitals. (Default: None, the Hamiltonian is read as an ordinary Jordan-Wigner one)
This is only relevant when tn_ansatz: 'givens' is chosen, and then makes \(U(\theta)\) a spin-restricted orbital rotation on the reduced register: \(D U D^\dagger\) is evaluated in closed form from the mapping matrix. measurement_method: 'grouped' is the natural partner here, since it works from the reduced operator itself and needs at most \(2^{Q+1}\) circuits however dense that operator is.
Values of \(-1\) as well as \(+1\) are accepted, a row with \(-1\) being the same occupation pattern carrying a phase; anything else is refused. Row numbers may have gaps, as they do when mol_map's output is reordered by spin, and the unlisted rows are treated as unphysical in the same way as the padding past the last row. The qubits are numbered as mol_map and Qiskit number them, with qubit 0 the least significant bit of the row number.
mapped_hamiltonian: array 2-d, list (float) The reduced operator itself, as a dense square matrix, either at the size of the mapping matrix's state count or padded out to the full \(2^Q\) register. mol_map produces it alongside the mapping matrix, so handing it over saves rebuilding it from the Pauli strings it was decomposed into — one dense \(2^Q\) term at a time, which for water is a hundred thousand of them and minutes of setup. It does not replace mapping_matrix, which is what tells the qubits index configurations and which orbitals each one occupies; that cannot be recovered from the operator. (Default: None, the operator is rebuilt from h_operators)
- Outputs:
VQE_energy: float The ground state energy of the input Hamiltonian, i.e. the lowest cost function value the optimization reached.
phi: list (floats) The values of the quantum circuit parameters phi reached during the optimization.
theta: list (floats) The values of the tensor network parameters theta reached during the optimization. On the orbital-rotation route (tn_ansatz: 'givens') these are the angles of the orbital rotation instead.
H_TN_opt_qubit: tuple (lists) The terms of Hamiltonian after tensor network optimization in Qubit operators. The first list includes the labels for the operators of the terms making up the Hamiltonian, in the following format: Each operator is represented by the corresponding letter ('X', 'Y' or 'Z') denoting its type, and an integer denoting which site/qubit it acts on. When a term involves more than a single operator, they are separated by a space. The second list holds the respective coefficient for each term.
If the original Hamiltonian was derived using the Jordan-Wigner transform, the output Hamiltonian can be turned back into a Fermionic Hamiltonian using OpenFermion. Should you want to do that transform, here is an example for how that can be derived from H_TN_opt_qubit:
from openfermion.ops import QubitOperator
from openfermion.transforms import reverse_jordan_wigner
# Initialize Hamiltonian
QB_ham = QubitOperator()
for pair in zip(*H_TN_opt_qubit):
QB_ham += QubitOperator(*pair)
# Transform qubit Hamiltonian to a Fermionic Hamiltonian
FO_ham = reverse_jordan_wigner(QB_ham)
FO_ham.compress()
print(FO_ham)
#Extract the coefficients and operators for each term
fermionic_operators = list(FO_ham.terms.keys())
H_TN_opt_fermionic = [FO_ham.terms[label] for label in fermionic_operators]
function_calls: int The number of times the cost function was called.
cost_history: list (floats) The history of the cost function during the optimization run, i.e. the value of the energy after each evaluation of the function. One entry per evaluation, which is not one per iteration: no solver spends a fixed number of evaluations on an iteration.
param_history: list (arrays of floats) The history of the parameter values during the optimization run, one entry per evaluation alongside cost_history. Each entry holds only the parameters the chosen optimization_mode varies: phi and theta concatenated for 'both', phi alone for 'circuit' and theta alone for 'network'.
iteration_history: list (floats) The energy at the end of each optimizer iteration, which is what a convergence curve wants: cost_history also holds the evaluations a solver spends probing around its iterate, and those sit above the point it settles on. The two cannot be derived from each other, since the number of evaluations per iteration varies within a run as well as between solvers. The first entry is the starting point's energy, so a run that never beat its start shows that plainly. Methods that hand scipy only the parameters rather than an intermediate result (SLSQP among them) give nan here rather than a guessed value.
iteration_boundaries: list (int) How many evaluations had been made at the end of each iteration, so cost_history can be cut into iterations even where iteration_history is nan. Its first entry is the evaluation that measured the starting point, which is not always the first one: SPSA calibrates its gain before looking at the start.
metadata: dict The metadata from the quantum computing runs/simulations. The format will depend on which device/backend is used. If a qiskit backend was used, this will be a list of dictionaries with the metadata from each estimator run. If a pennylane QNode was used, this will be a dictionary of the output of tracker.history. For both pennylane and qiskit metadata, and when optimizing both \(\phi\) and \(\theta\), two keys are added: n_circuits and n_measured, that capture the number of expectation values needed for each cost function evaluation and the number of measured expectation values respectively. The latter can be lower than the former due to measurement caching when only \(\theta\) is updated. The key is always present: when optimization_mode is 'network' no quantum measurements are made, and it is then an empty dictionary rather than absent.
OptimizeResult: dict The full output of scipy.optimize.minimize as a dictionary. It covers only the parameters the chosen optimization_mode varied. The two solvers above add fields of their own worth reading: SPSA reports improved, false when nothing it tried beat the starting point, and wandered, how far the iterates moved at the furthest; ExcitationSolve reports the frequencies it used per parameter, which are worth keeping since passing them back in skips the measuring, and flat_parameters, the parameters the energy turned out not to depend on.
Zero-noise Extrapolation for Variational Quantum Algorithms¶
Variational Quantum Algorithms (VQAs) like the Variational Quantum Eigensolver (VQE) are specifically designed to run effectively on near-term quantum computers, which lack quantum error correction. Consequently, there’s substantial interest in determining whether these algorithms can provide practical computational advantages. In chemistry, accurately predicting molecular energies with classical methods (such as Density Functional Theory, Coupled Cluster, and Full Configuration Interaction) can be extremely computationally expensive. Quantum computing, with its natural ability to represent quantum entanglement and correlations between particles, has the potential to significantly accelerate these calculations. Thus, enhancing VQAs through error mitigation methods such as Zero-noise Extrapolation (ZNE) is relevant to areas such as pharmaceuticals, energy, and catalysis – which together have a global market size of trillions of dollars – for molecular and material design both in industry and academic research.
ZNE works by intentionally increasing noise in quantum circuits via redundant gates, measuring the expectation value of a circuit with respect to some operator at different noise levels, and then extrapolating with a curve fit to estimate the zero-noise result.
MQS has systematically benchmarked different ZNE configurations – combinations of noise factors, noise amplification methods, and extrapolation techniques – to identify which configurations yield the most accurate and reliable improvements to VQE, as well as which configurations lead to unrealistic energy estimates.
We ran a series of experiments to benchmark various ZNE configurations for VQE using Qiskit and classical simulation with the IBM Brisbane noise model. From the experiments run, the best-performing ZNE configurations for the analyzed VQE cases in terms of stability and accuracy involve a large number of noise scalars (such as 12 factors between 1 and 6.5), two-qubit gate folding, and quadratic extrapolation. The cubic and exponential extrapolation methods can be prone to producing unphysical energies. By mapping which options consistently converge toward the noiseless energy and which diverge, a recipe for reliable error mitigation in VQE is provided.

ZNE can help one progress towards chemical accuracy with VQAs as shown in our results from the best-performing configuration. Note that this experiment was not tuned for chemical accuracy, it simply demonstrates how ZNE can take one closer to that target.

Genetic gate-based quantum circuit generation¶
See Xenakis repository: Link
QPUBench quantum computing benchmark framework¶
Check out the dedicated QPUBench webpage: QPUBench.org

Quantum computing research articles from MQS¶
- Resource efficient method for representation and measurement of constrained electronic structure states with a quantum computer
- A joint optimization approach of parameterized quantum circuits with a tensor network
- Comparative Studies of Quantum Annealing, Digital Annealing, and Classical Solvers for Reaction Network Pathway Analysis and mRNA Codon Selection
- Quantum phase estimation with optimal confidence interval using three control qubits
Completed and current MQS projects:¶
PhotoQ: Photonic quantum computing project involving measurement-based quantum computing and Gaussian boson sampling (GBS).
DLR Quantum Computing Initiative - QuantiCoM Project: Advanced water simulations with classical and quantum computing.
Q-Chemion: end to end quantum computing calculation pipeline with QEDMA, Oxford Ionics, Copenhagen University and the Technical University of Denmark (DTU).
MQS x Fraunhofer SCAI Benchmarking Framework: In collaboration with Fraunhofer MQS has developed a quantum computing algorithms benchmarking framework to assess methods related to quantum computing enhanced quantum chemistry calculations (to be released).
Quantum Innovation Challenge: Quantum Innovation Challenge in collaboration with Novo Foundation, BioInnovation Institute (BII), DCAI, QAI Ventures and many more. The annual challenge focuses on applications of quantum computing within the life sciences.
-
Kaur Kristjuhan and Mark Nicholas Jones. Resource efficient method for representation and measurement of constrained electronic structure states with a quantum computer. 2023. URL: https://arxiv.org/abs/2303.01122, arXiv:2303.01122. ↩
-
Clara Ferreira Cores, Kaur Kristjuhan, and Mark Nicholas Jones. A joint optimization approach of parameterized quantum circuits with a tensor network. 2024. URL: https://arxiv.org/abs/2402.12105, arXiv:2402.12105. ↩↩