Circuits
Builders
PauliPropagation.appendSU4! — MethodappendSU4!(circuit, pair)Append a layer of SU(4) gates to a circuit on a given pair of qubits. The SU(4) gate is decomposed via the KAK Decomposition into single-qubit Z-X-Z gates on each qubit, followed by XX-YY-ZZ gates and again single-qubit Z-X-Z gates, for a total of 15 Pauli gates.
PauliPropagation.efficientsu2circuit — Methodefficientsu2circuit(nqubits::Integer, nlayers::Integer; topology=nothing)Create a hardware-efficient circuit consisting of layers of single-qubit Y-Z Pauli gates and CNOT entangling gates. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used.
PauliPropagation.hardwareefficientcircuit — Methodhardwareefficientcircuit(nqubits::Integer, nlayers::Integer; topology=nothing)Create a hardware-efficient circuit consisting of layers of single-qubit X-Z-X Pauli gates and YY entangling gates. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used.
PauliPropagation.heisenbergtrottercircuit — Methodheisenbergtrottercircuit(nqubits::Integer, nlayers::Integer; topology=nothing)Create a circuit that corresponds to a Trotterization of the Heisenberg Hamiltonian. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used. Note that the gates are applied as layers of XX-YY-ZZ gates, not as layers of XX on all, then YY on all, then ZZ on all. On the bricklayer topology, these are equivalent.
PauliPropagation.qcnncircuit — Methodqcnncircuit(nqubits::Integer; periodic=false)Create a Quantum Convolutional Neural Network (QCNN) circuit on nqubits qubits. The topology for the circuit is created by creating bricklayer topologies on half the qubits every layer. The final qubits are qubit 1 and ~nqubits/2, which should be measured.
PauliPropagation.rxlayer! — Methodrxlayer!(circuit, nqubits)Append a layer of single-qubit PauliRotation(:X, qind) gates to the circuit for each pair in the topology.
PauliPropagation.rxxlayer! — Methodrxxlayer!(circuit, topology)Append a layer of two-qubit PauliRotation([:X, :X], pair) gates to the circuit for each pair in the topology.
PauliPropagation.rylayer! — Methodrylayer!(circuit, nqubits)Append a layer of single-qubit PauliRotation(:Y, qind) gates to the circuit for each pair in the topology.
PauliPropagation.ryylayer! — Methodryylayer!(circuit, topology)Append a layer of two-qubit PauliRotation([:Y, :Y], pair) gates to the circuit for each pair in the topology.
PauliPropagation.rzlayer! — Methodrzlayer!(circuit, nqubits)Append a layer of single-qubit PauliRotation(:Z, qind) gates to the circuit for each pair in the topology.
PauliPropagation.rzzlayer! — Methodrzzlayer!(circuit, topology)Append a layer of two-qubit PauliRotation([:Z, :Z], pair) gates to the circuit for each pair in the topology.
PauliPropagation.su4circuit — Methodsu4circuit(nqubits::Integer, nlayers::Integer; topology=nothing)Create a circuit that consists of layers of SU(4) gates on a given topology. SU(4) gates are decomposed via the KAK Decomposition into single-qubit Z-X-Z gates on each qubit, followed by XX-YY-ZZ gates and again single-qubit Z-X-Z gates, for a total of 15 Pauli gates. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used.
PauliPropagation.tfitrottercircuit — Methodtfitrottercircuit(nqubits::Integer, nlayers::Integer; topology=nothing, start_with_ZZ=true)Create a circuit that corresponds to a Trotterization of the transverse-field Ising Hamiltonian. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used. If start_with_ZZ is set to true, the circuit starts with a layer of ZZ gates, else with a layer of X gates. This is relevant depending on the initial state.
PauliPropagation.tiltedtfitrottercircuit — Methodtiltedtfitrottercircuit(nqubits, n_layers; topology=nothing)Returns a Trottterized circuit for the tilted transverse field Ising model. H = Sum{(i, i+1) in topology} Zi Z_{i+1}
- Sum{i=1}^{nqubits} Zi + Sum{i=1}^{nqubits} Xi
Arguments
nqubits::Integer: The number of qubits in the circuit.n_layers::Integer: The number of Trotter steps to perform.topology=nothing: The topology of the qubits in the circuit. Default (nothing): A linear chain.
Returns
The Trottterized circuit as a vector of Gate.
Topologies
PauliPropagation.ibmeagletopology — ConstantibmeagletopologyTopology of the IBM Eagle device with 127 qubits. Also called the heave-hex topology on 127 qubits.
PauliPropagation.bricklayertopology — Methodbricklayertopology(qindices; periodic=false)Create the topology of a so-called 1D bricklayer circuit on a subset of qubits indicated by qindices. If periodic is set to true, the last qubit is connected to the first qubit.
PauliPropagation.bricklayertopology — Methodbricklayertopology(nqubits::Integer; periodic=false)Create the topology of a so-called 1D bricklayer circuit on nqubits qubits. It consists of two sublayers connecting odd-even and eve-odd qubit indices, respectively. If periodic is set to true, the last qubit is connected to the first qubit.
PauliPropagation.rectangletopology — Methodrectangletopology(nx::Integer, ny::Integer; periodic=false)Create a 2D topology on a grid of nx by ny qubits. The order is none in particular and may need to be adapted for specific purposes. If periodic is set to true, the grid is connected periodically in both directions.
PauliPropagation.staircasetopology — Methodstaircasetopology(nqubits::Integer; periodic=false)Create a 1D staircase topology on nqubits qubits. The qubits are connected in a staircase pattern, where qubit i is connected to qubit i+1. If periodic is set to true, the last qubit is connected to the first qubit.
PauliPropagation.staircasetopology2d — Methodstaircasetopology2d(nx::Integer, ny::Integer)Create a 2D staircase topology on a grid of nx by ny qubits. Mind the order of the topology, which forms a staircase spanning the grid -> in the Schrödinger picture <-. An observable acting on qubits index nqubits may interact non-trivially with every gate on the topology. Can topology can either be pathological or the most simple, depending on which index observables are non-identity.
Utils
PauliPropagation.countparameters — Methodcountparameters(circuit)Utility function to count the number of gates of type ParametrizedGate in a circuit.
PauliPropagation.getparameterindices — Methodgetparameterindices(circuit, ::PauliRotation, gate_symbols::Vector{Symbol}), qinds::Vector{Int})Utility function to get the parameter indices of PauliRotation gates with symbol gate_symbols acting on the qubits qinds. For example, getparameterindices(circuit, PauliRotation, [:X], [1]).
PauliPropagation.getparameterindices — Methodgetparameterindices(circuit, ::PauliRotation, gate_symbols::Vector{Symbol}))Utility function to get the parameter indices of PauliRotation gates with symbol gate_symbols. For example, getparameterindices(circuit, PauliRotation, [:X]).
PauliPropagation.getparameterindices — Methodgetparameterindices(circuit, GateType<:ParametrizedGate)Utility function to get the parameter indices of gates of type GateType in a circuit. This naturally only works for gates that subtype ParametrizedGate.