noise_mapper_py

HQS noise mapper Python interface.

The HQS Quantum Simulations GmbH noise mapper implements noise mapping, the construction of a static noisy algorithm model based on a quantum circuit and physical noise on a quantum computer. For more details see also http://arxiv.org/abs/2210.11371

Copyright © 2021-2023 HQS Quantum Simulations GmbH. All Rights Reserved. License details given in distributed LICENSE file.

noisy_algorithm_model(circuit, hamiltonian, ...)

Construct the noisy algorithm model from a circuit with noise operations.

noisy_algorithm_model_pure_noise(circuit, ...)

Construct the noise part of the noisy algorithm model from a circuit with noise operations.

Functions

estimate_decoherence_rate(circuit, ...)

Estimate a lower bound for the average decoherence rate on all qubits involved in a circuit.

noisy_algorithm_model(circuit, hamiltonian, ...)

Construct the noisy algorithm model from a circuit with noise operations.

noisy_algorithm_model_pure_noise(circuit, ...)

Construct the noise part of the noisy algorithm model from a circuit with noise operations.

noise_mapper_py.estimate_decoherence_rate(circuit, trotter_timestep)

Estimate a lower bound for the average decoherence rate on all qubits involved in a circuit.

The function iterates through the circuit, summing the noise contributions given by the noise Pragmas in the circuit. This value is the normalised by the trotter timestep and by the number of qubits in the circuit.

Parameters:
  • circuit (qoqo.Circuit) -- The circuit of one Trotter-Step already annotated with noise operations.

  • trotter_timestep (float) -- The virtual time the circuit propagates a state that has been prepared on the quantum computer.

Returns:

The estimated decoherence rate.

Return type:

CalculatorFloat

Example:

>>> from noise_mapper_py import estimate_decoherence_rate
... from qoqo import Circuit
... from qoqo import operations as ops
...
... circuit = Circuit()
... circuit += ops.PragmaStartDecompositionBlock([0], {})
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.RotateZ(0, 0.01)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.PragmaStopDecompositionBlock([0])
...
... rate = estimate_decoherence_rate(circuit, 0.01)
noise_mapper_py.noisy_algorithm_model(circuit, hamiltonian, trotter_timestep)

Construct the noisy algorithm model from a circuit with noise operations.

The noisy algorithm model is the static noise model that effectively determines the time propagation when a quantum algorithm for the coherent time propagation under a Hamiltonian is run on a quantum computer with physical noise. For a detailed discussion see also http://arxiv.org/abs/2210.11371.

Parameters:
  • circuit (qoqo.Circuit) -- The circuit of one Trotter-Step already annotated with decomposition blocks and noise operations.

  • hamiltonian (SpinHamiltonianSystem) -- The Hamiltonian that determines the coherent part of the time evolution.

  • trotter_timestep (float) -- The virtual time the circuit propagates a state that has been prepared on the quantum computer.

Example:

>>> from noise_mapper_py import noisy_algorithm_model
... from qoqo import Circuit
... from qoqo import operations as ops
... from struqture_py import spins
...
... circuit = Circuit()
... # To be able to construct the noisy alqorithm model
... # the parts to the circuit simulation the
... circuit += ops.PragmaStartDecompositionBlock([0], {})
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.RotateZ(0, 0.01)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.PragmaStopDecompositionBlock([0])
...
... system = spins.SpinHamiltonianSystem(1)
... system.set(spins.PauliProduct().x(0), 2)
...
... open_sytem = noisy_algorithm_model(circuit, system, 0.01)

Note:

To be as general as possible the noisy-algorithm extraction does not construct the quantum circuit that propagates a state for a virtual time. For the same reason the extraction method does not default to any physical noise model, but uses noise terms that have already been inserted in the circuit. The noise mapper can extract the noise for all circuits that meet the following conditions:

  • The circuit implements one Trotter step in a time propagation

  • The original Hamiltonian can be written as a sum of partial Hamiltonians

    H = H1 + H2 + ...

  • The segments of the circuit that implement the time propagation under

    a partial Hamiltonian Hkare denoted by PragmaStartDecompositionBlock and PragmaStopDecompositionBlock

  • The decomposition blocks do not overlap

  • The circuit does not have free symbolic parameters

  • The circuit already contains the effect of physical device noise

    on the circuit level, represented by qoqo noise operations like PragmaDamping, PragmaDephasing etc.

The method makes the assumption that the trotter-timestep t is short enough so that if LL1 and LL2 are Lindblad superoperators, exp(LL1 t) exp(LL2 t) is approximately equal to exp((LL1 + LL2) t) where exp(LL t) is shorhand for applying the full time propagation under the Lindblad superoperator LL

noise_mapper_py.noisy_algorithm_model_pure_noise(circuit, trotter_timestep)

Construct the noise part of the noisy algorithm model from a circuit with noise operations.

The noisy algorithm model is the static noise model that effectively determines the time propagation when a quantum algorithm for the coherent time propagation under a Hamiltonian is run on a quantum computer with physical noise. For a detailed discussion see also http://arxiv.org/abs/2210.11371.

Parameters:
  • circuit (qoqo.Circuit) -- The circuit of one Trotter-Step already annotated with decomposition blocks and noise operations.

  • trotter_timestep (float) -- The virtual time the circuit propagates a state that has been prepared on the quantum computer.

Example:

>>> from noise_mapper_py import noisy_algorithm_model_pure_noise
... from qoqo import Circuit
... from qoqo import operations as ops
... from struqture_py import spins
...
... circuit = Circuit()
... # To be able to construct the noisy alqorithm model
... # the parts to the circuit simulation the
... circuit += ops.PragmaStartDecompositionBlock([0], {})
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.RotateZ(0, 0.01)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.Hadamard(0)
... circuit += ops.PragmaDamping(0, 1e-3, 1e-3)
... circuit += ops.PragmaStopDecompositionBlock([0])
...
... noise_sytem = noisy_algorithm_model_pure_noise(circuit, system, 0.01)

Note:

To be as general as possible the noisy-algorithm extraction does not construct the quantum circuit that propagates a state for a virtual time. For the same reason the extraction method does not default to any physical noise model, but uses noise terms that have already been inserted in the circuit. The noise mapper can extract the noise for all circuits that meet the following conditions:

  • The circuit implements one Trotter step in a time propagation

  • The original Hamiltonian can be written as a sum of partial Hamiltonians

    H = H1 + H2 + ...

  • The segments of the circuit that implement the time propagation under

    a partial Hamiltonian Hkare denoted by PragmaStartDecompositionBlock and PragmaStopDecompositionBlock

  • The decomposition blocks do not overlap

  • The circuit does not have free symbolic parameters

  • The circuit already contains the effect of physical device noise

    on the circuit level, represented by qoqo noise operations like PragmaDamping, PragmaDephasing etc.

The method makes the assumption that the trotter-timestep t is short enough so that if LL1 and LL2 are Lindblad superoperators, exp(LL1 t) exp(LL2 t) is approximately equal to exp((LL1 + LL2) t) where exp(LL t) is shorhand for applying the full time propagation under the Lindblad superoperator LL