Quantum registers#

The MPS is a convenient representation to store, manipulate and interrogate a quantum register of qubits. We now list some algorithms imported from the world of quantum computing, which have been reimplemented using MPO’s and MPS’s.

Quantum circuits#

The module seemps.register.circuits provides a series of classes that implement local and two-qubit transformations onto an MPS that encodes a quantum register. These include the following ones:

VQECircuit(register_size, layers[, ...])

Variational quantum circuit with Ry rotations and CNOTs.

ParameterizedLayeredCircuit(register_size, ...)

Variational quantum circuit with Ry rotations and CNOTs.

LocalRotationsLayer(register_size, operator)

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

TwoQubitGatesLayer(register_size, operator)

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

The ParameterizedLayeredCircuit is a composite circuit that can be built from LocalRotationsLayer or TwoQubitGatesLayer circuits.

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)

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)

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(state, **kwargs)

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

iqft(state, **kwargs)

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

qft_mpo(N[, sign])

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

iqft_mpo(N, **kwargs)

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])

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])

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])

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])

Return the MPO associated to a QUBO operator.

qubo_exponential_mpo([J, h, beta])

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