Circuits

Builders

PauliPropagation.tfitrottercircuitFunction
tfitrottercircuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits), start_with_ZZ=true)

Create a circuit that corresponds to a Trotterization of the transverse-field Ising Hamiltonian.

\[H = ∑_{(i,j) ∈ topology} J_{ij} Z_i Z_j + ∑_{i=1 ... nqubits} h_i X_i\]

This returns only the sequence of gates, not their parameters. 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.

source
PauliPropagation.tiltedtfitrottercircuitFunction
tiltedtfitrottercircuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits))

Create a circuit that corresponds to a Trotterization of the transverse-field Ising Hamiltonian.

\[H = ∑_{(i,j) ∈ topology} J_{ij} Z_i Z_j + ∑_{i=1 ... nqubits} h_i Z_i + ∑_{i=1 ... nqubits} b_i X_i\]

This returns only the sequence of gates, not their parameters. A topology can be specified as a list of pairs of qubit indices. If no topology is specified, a bricklayer topology is used.

source
PauliPropagation.heisenbergtrottercircuitFunction
heisenbergtrottercircuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits))

Create a circuit that corresponds to a Trotterization of the Heisenberg Hamiltonian.

\[H = ∑_{(i,j) ∈ topology} Jzz_{ij} Z_i Z_j + Jxx_{ij} X_i X_j + Jyy_{ij} Y_i Y_j\]

This returns only the sequence of gates, not their parameters. 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.

source
PauliPropagation.hardwareefficientcircuitFunction
hardwareefficientcircuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits))

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.

source
PauliPropagation.efficientsu2circuitFunction
efficientsu2circuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits))

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.

source
PauliPropagation.su4circuitFunction
su4circuit(nqubits::Integer, nlayers::Integer; topology=bricklayertopology(nqubits))

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.

source
PauliPropagation.rxlayer!Function
rxlayer!(circuit, nqubits)

Append a layer of single-qubit PauliRotation(:X, qind) gates to the circuit for each pair in the topology.

source
PauliPropagation.rylayer!Function
rylayer!(circuit, nqubits)

Append a layer of single-qubit PauliRotation(:Y, qind) gates to the circuit for each pair in the topology.

source
PauliPropagation.rzlayer!Function
rzlayer!(circuit, nqubits)

Append a layer of single-qubit PauliRotation(:Z, qind) gates to the circuit for each pair in the topology.

source
PauliPropagation.rxxlayer!Function
rxxlayer!(circuit, topology)

Append a layer of two-qubit PauliRotation([:X, :X], pair) gates to the circuit for each pair in the topology.

source
PauliPropagation.ryylayer!Function
ryylayer!(circuit, topology)

Append a layer of two-qubit PauliRotation([:Y, :Y], pair) gates to the circuit for each pair in the topology.

source
PauliPropagation.rzzlayer!Function
rzzlayer!(circuit, topology)

Append a layer of two-qubit PauliRotation([:Z, :Z], pair) gates to the circuit for each pair in the topology.

source
PauliPropagation.qcnncircuitFunction
qcnncircuit(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.

source
PauliPropagation.appendSU4!Function
appendSU4!(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.

source

Topologies

PauliPropagation.bricklayertopologyMethod
bricklayertopology(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.

source
PauliPropagation.bricklayertopologyMethod
bricklayertopology(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.

source
PauliPropagation.rectangletopologyMethod
rectangletopology(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.

source
PauliPropagation.staircasetopologyMethod
staircasetopology(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.

source
PauliPropagation.staircasetopology2dMethod
staircasetopology2d(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.

source

Utils

PauliPropagation.getparameterindicesMethod
getparameterindices(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]).

source
PauliPropagation.getparameterindicesMethod
getparameterindices(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]).

source
PauliPropagation.getparameterindicesMethod
getparameterindices(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.

source