Quantum registers#

The MPS is a convenient representation to store, manipulate and interrogate a quantum register of qubits. SeeMPS can be used to classically simulate weakly entangled computations, as MPS provide an efficient representation for quantum states with limited entanglement.

SeeMPS’s architecture is well suited for quantum circuit emulation:

  • A single MPO can represent a layer of quantum gates encoded with low bond dimension

  • Several layers can be chained into an MPOList to represent a quantum circuit

  • Standard contraction and simplification routines study how circuits act on an MPS quantum register

Parameterized quantum circuits#

The module seemps.register.circuits provides a framework for variational quantum algorithms. The main class is ParameterizedLayeredCircuit, which is a collection of unitary operations with and without parameters.

Available layer types#

LocalRotationsLayer

Layer of local rotations acting on the each qubit with the same generator and possibly different angles.

TwoQubitGatesLayer

Layer of CNOT/CZ gates, acting on qubits 0 to N-1, from left to right or right to left, depending on the direction.

HamiltonianEvolutionLayer

Exponential of a Hamiltonian acting on the quantum register.

ParameterFreeMPO

A quantum register unitary transformation, given by an MPO with no parameters.

Circuit composition#

The ParameterizedLayeredCircuit is a composite circuit that can be built from parameterized layers as well as MPO and MPOList transformations without parameters.

ParameterizedLayeredCircuit

Variational quantum circuit with Ry rotations and CNOTs.

For example, the following two codes create equivalent operators, U3 and U4:

>>> from seemps.register.circuits import *
>>> U1 = LocalRotationsLayer(register_size=2, operator='Sz')
>>> U2 = TwoQubitGatesLayer(register_size=2)
>>> U3 = ParameterizedLayeredCircuit(register_size=2, layers=[U1, U2])
>>> U4 = VQECircuit(register_size=2, layers=2)

Parameterized application#

The circuits are “parameterized” because the rotation depends on angles that are provided at construction time or when the unitaries are applied. For instance, the following two codes produce the same state:

>>> p = [0.13, -0.25]
>>> U1 = LocalRotationsLayer(register_size=2, operator='Sz', same_angle=False, default_parameters=p)
>>> state = U1.apply(state)

Or the alternative:

>>> p = [0.13, -0.25]
>>> U1 = LocalRotationsLayer(register_size=2, operator='Sz', same_angle=False)
>>> state = U1.apply(state, p)

Pre-built variational circuits#

SeeMPS provides pre-built circuits for common variational algorithms:

VQECircuit

Variational quantum circuit with Ry rotations and CNOTs.

IsingQAOACircuit

Variational QAOA circuit for the Ising model.

These can be used for variational quantum eigensolver implementations, quantum machine learning models, and analysis of variational states created by QAOA circuits.

Fourier transforms#

SeeMPS also provides matrix-product operators and functions that implement the quantum Fourier transform. In some cases the functions and MPO’s act over the whole quantum register (qft(), qft_mpo(),…) and in other cases you can specify a subset of quantum systems (qft_nd_mpo(), etc).

qft(-> MPS)

Apply the quantum Fourier transform onto a quantum register of qubits encoded in the matrix-product 'state'.

iqft(-> MPS)

Apply the inverse quantum Fourier transform onto a quantum register of qubits encoded in the matrix-product 'state'.

qft_mpo(N[, sign, strategy])

Create an MPOList object representing a Quantum Fourier Transform for a quantum register with N qubits.

iqft_mpo(N[, strategy])

MPOList implementing the inverse quantum Fourier transform.

qft_flip(state)

Swap the qubits in the quantum register, to fix the reversal suffered during the quantum Fourier transform.

qft_nd_mpo(sites[, N, sign, strategy])

Create an MPOList object representing a Quantum Fourier Transform for subset of qubits in a quantum register with N qubits.

iqft_nd_mpo(sites[, N, strategy])

Create an MPOList object representing the inverse Quantum Fourier Transform for subset of qubits in a quantum register with N qubits.

Other transformations#

twoscomplement(L[, control, sites, strategy])

Return an MPO that performs a two's complement of the selected qubits depending on a 'control' qubit in a register with L qubits.

qubo_mpo([J, h, strategy])

Return the MPO associated to a QUBO operator.

qubo_exponential_mpo([J, h, beta, strategy])

Return the MPO associated to the exponential $exp(beta H)$ of a QUBO operator.