Processing math: 100%

Examples

In the following, we give a minimal example for extracting the noisy algorithm model that implements one Trotter step for the time propagation under a Hamiltonian H=σx,, where the time propagation is implemented by a sequence of three unitary gates: a Hadamard followed by a Z-rotation followed by another Hadamard.

from hqs_quantum_libraries.noise_mapper 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.PauliHamiltonian() system.set(spins.PauliProduct().x(0), 2) open_system = noisy_algorithm_model(circuit, system, 0.01) print(open_system)