Functionality

Please note that HQS Noise Mapper is intented to be used in conjunction with other quantum computing libraries by HQS Quantum Simulations GmbH, especially the open source libraries qoqo and struqture.

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 only returns 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 such parameters 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 you use).
  • 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, every portion needs to be wrapped in decomposition blocks to signal that the respective gate sequences within the blocks correspond to the application of a exponential that is parametrically small (i.e., comparable 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 the noise acts on need to be remapped when commuting noise 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 that represents 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:

  1. Marking the decomposition blocks, which are the parts of the circuit that correspond to implementing a partial time propagation under a \(H_k\)
  2. Information about the physical noise

1. Decomposition block annotation

Please note that 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 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 spins are mapped to qubits one to one, the involved qubits 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 is the case for 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 form,

reordering_dictionary = {2:3, 3:2}

Note: For the noisy algorithm model to be calculated, the decomposition blocks cannot overlap. A new decomposition block can only start once the previous decomposition block has been stopped. Also note that when inserting "book-keeping" operations in a circuit, such as SWAP operations, those operations also need to be enclosed in a decomposition block as they correspond to implementing the time propagation under an empty Hamiltonian \(H_k = 0\).

2. Noise information

The noise information is also directly annotated in the circuit. For generality, 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 that act at specific points in the circuit.

Please be reminded, that HQS Noise Mapper is intented to be used in conjunction with the open source libraries qoqo and struqture by HQS Quantum Simulations GmbH. For the annotation of noise in the input circuit the following qoqo operations can be used: PragmaDamping, PragmaDephasing, PragmaDepolarising and PragmaGeneralNoise, which all 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 functions for noise mapping:

  • 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 timestep. The Trotter timestep represents the virtual time the system is propagated for during one Trotter step. The following code snippet briefly describes how the function is called.

from noise_mapper_py import noisy_algorithm_model

# Preprocessing noisy algorithm inputs
# ...

# Calling the noise mapper function
noisy_system = noisy_algorithm_model(
     circuit, #type Circuit
     hamiltonian, #type SpinHamiltonianSystem 
     trotter_timestep #type float
)

print(type(noisy_system)) # SpinLindbladOpenSystem

The function returns an object of type struqture_py.spins.SpinLindbladOpenSystem.

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.SpinLindbladNoiseSystem.

from noise_mapper_py 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)) # SpinLindbladNoiseSystem

Further examples

Readers can find detailed examples in the Examples.