Functionality
Please note that HQS Noise Mapper is intended to be used in conjunction with other quantum computing libraries by HQS Quantum Simulations GmbH, especially the open source libraries qoqo and struqture.
The HQS Noise Mapper provides the following functions:
noisy_algorithm_model
, which returns the full noisy algorithm model including coherent terms. It takes as input the annotated circuit of one Trotter step, the original Hamiltonian and the Trotter time step.noisy_algorithm_model_pure_noise
also provides noise-mapping functionality but returns only the effective noise part of the noisy algorithm model. It does not require the Hamiltonian as input.
Overview
HQS Noise Mapper aims to identify the noisy algorithm model that can be effectively simulated on noisy hardware.
Input
In order to describe the dynamics of a quantum system, the Trotterization method is applied to simulate the time evolution. This method may require the user to provide certain parameters, such as Trotter step size or the number of Trotter steps.
Further required information is:
- The Trotter step size, which is important for the correct re-scaling of the Lindblad terms of the calculated noisy algorithm model.
- The original Hamiltonian (depending on the function used).
- The noisy quantum circuit (i.e., including noise gates) implementing a Trotter step of the time evolution of a spin system for which we want to find the noisy algorithm model.
- In the noisy quantum circuit, each portion must be wrapped in decomposition blocks to signal that
the respective gate sequences within the blocks correspond to the application of an exponential that is parametrically small (i.e., comparable to or smaller than the Trotter step size).
- This is important information for the code to be able to commute noise through the circuit while staying within the error bars of the Trotter approximation.
- Furthermore, the decomposition blocks contain all the information about swapping operations, and whether the qubit indices that the noise is acting on need to be remapped when the noise commutes past the block.
Output
The output of our tool is then the sum of all generated noise terms, which corresponds to the Lindblad noise operator of the noisy algorithm model.
Conditions
Noise mapping works when the quantum algorithm under consideration is fundamentally of the Trotterization type, meaning that the original Hamiltonian can be written as a sum of local Hamiltonians \[ H = \sum_k H_k \] and the time propagation under each \(H_k\) is given by a well-defined sequence of native quantum gates.
The noisy algorithm model can be extracted from a quantum circuit representing one Trotter step in a Trotterized time propagation algorithm.
To be as general as possible, the noisy algorithm extraction does not construct this quantum circuit that propagates a state for a virtual time. The noise mapper accepts circuits that have already been fully compiled for the target architecture and annotated with the necessary meta-information.
Two forms of metadata annotation are required to apply noise mapping, as described in the following subsections:
- Marking of the decomposition blocks, which are the parts of the circuit corresponding to the implementation of a partial time propagation under a \(H_k\).
- Information about the physical noise.
1. Decomposition Block Annotation
Please note that the HQS Noise Mapper is intended to be used in conjunction with the open source libraries qoqo and struqture by HQS Quantum Simulations GmbH.
The decomposition blocks are marked by inserting
- a
PragmaStartDecompositionBlock(qubits, reordering_dictionary)
at the start of a decomposition block - a
PragmaStopDecompositionBlock(qubits)
at its end.
The qubits
are in this case a list of the qubits that are involved in the decomposition block. For example, when the decomposition block represents the time propagation under the partial Hamiltonian \(H_k = Z_2 Z_3\) of the interaction between two spins \(2\) and \(3\) and the spins are mapped to qubits one-to-one, the qubits
involved would be [2, 3]
.
The reordering_dictionary
is used when a decomposition block not only implements a partial Hamiltonian time propagation, but also reorders the qubits, as in SWAP networks. In the above example, if the decomposition block would also swap the definition of qubit \(2\) and \(3\) the reordering_dictionary
would take the following form:
reordering_dictionary = {2:3, 3:2}
Note: To calculate the noisy algorithm model, the decomposition blocks cannot overlap. A new decomposition block cannot start until the previous decomposition block has been stopped. Also note that when "bookkeeping" operations are inserted into a circuit, such as SWAP operations, these operations must also be enclosed in a decomposition block, as they correspond to the implementation of time propagation under an empty Hamiltonian \(H_k = 0\).
2. Noise Information
The noise information is also annotated directly in the circuit. For generality's sake, we do not assume a specific device-based noise model. The action of the physical noise on the quantum computer is represented by discrete noise operations acting at specific points in the circuit.
Please remember that the HQS Noise Mapper is intended to be used in conjunction with the open source libraries qoqo and struqture by HQS Quantum Simulations GmbH. To annotate the noise in the input circuit, the following qoqo operations can be used: PragmaDamping
, PragmaDephasing
, PragmaDepolarising
and PragmaGeneralNoise
, all of which correspond to a Lindblad-type master equation acting on a specific qubit for a finite gate_time
. For more information, see the qoqo documentation.
Noise Mapping Functions
The Noise Mapper provides two noise mapping functions:
noisy_algorithm_model
noisy_algorithm_model_pure_noise
Function noisy_algorithm_model
The function noisy_algorithm_model
returns the full noisy algorithm model including coherent terms. It takes as input the annotated circuit of one Trotter step, the original Hamiltonian, and the Trotter time step. The Trotter time step represents the virtual time for which the system is propagated during one Trotter step. The following code snippet briefly describes how to call the function.
from hqs_quantum_libraries.noise_mapper import noisy_algorithm_model
# Preprocessing noisy algorithm inputs
# ...
# Calling the noise mapper function
noisy_system = noisy_algorithm_model(
circuit, #type Circuit
hamiltonian, #type PauliHamiltonian
trotter_timestep #type float
)
print(type(noisy_system)) # PauliLindbladOpenSystem
The function returns an object of type struqture_py.spins.PauliLindbladOpenSystem
.
Note that the noisy_algorithm_model
cannot check that the provided Hamiltonian corresponds to the time propagation implemented by the circuit.
Function noisy_algorithm_model_pure_noise
The function noisy_algorithm_model_pure_noise
also provides noise mapping functionality, but only returns the effective noise part of the noisy algorithm model. It does not require the Hamiltonian as input and it returns an object of type struqture_py.spins.PauliLindbladNoiseOperator
.
from hqs_quantum_libraries.noise_mapper import noisy_algorithm_model_pure_noise
# Preprocessing noisy algorithm inputs
# ...
# Calling the noise mapper function
noise = noisy_algorithm_model_pure_noise(
circuit, #type Circuit
trotter_timestep #type float
)
print(type(noise)) # PauliLindbladNoiseOperator
Further Examples
Readers can find detailed examples in the Examples.