Tensor Networks

piqture.tensor_networks.base_tensor_network module

Base Tensor Network Circuit

class piqture.tensor_networks.base_tensor_network.BaseTensorNetwork(num_qubits: int)

Bases: ABC

Abstract Base Class for Tensor Network Circuits

property circuit

Returns the tensor network circuit property.

piqture.tensor_networks.mera module

Multiscale Entanglement Renormalization Ansatz (MERA) Tensor Network

class piqture.tensor_networks.mera.MERA(num_qubits: int, layer_depth: int | None = None)

Bases: BaseTensorNetwork

Implements a Multiscale Entanglement Renormalization Ansatz (MERA) tensor network structure as given by [2].

References:

[1] E. Grant et al., “Hierarchical quantum classifiers,” npj Quantum Information, vol. 4, no. 1, Dec. 2018, doi: https://doi.org/10.1038/s41534-018-0116-9.

[2] G. Vidal, “Class of Quantum Many-Body States That Can Be Efficiently Simulated,” Physical Review Letters, vol. 101, no. 11, Sep. 2008, doi: https://doi.org/10.1103/physrevlett.101.110501.

mera_backbone(gate_structure: Callable, param_vector_copy: ParameterVector, complex_structure: bool = True) QuantumCircuit

Lays out the backbone structure of a MERA circuit onto which the unitary gates are applied.

Args:

gate_structure (Callable): calls the function with the required unitary gate parameterization structure.

param_vector_copy (ParameterVector): list of unitary gate parameters to be used in the circuit.

complex_structure (bool): If True, builds the MERA structure with complex unitary gates (e.g. RY, etc.)

Returns:

circuit (QuantumCircuit): Returns the MERA circuit generated with the help of the input arguments.

mera_general(complex_structure: bool = True) QuantumCircuit

Builds a MERA circuit with a general unitary gate parameterization. Refer [1].

Args:

complex_structure (bool): If True, builds the MERA structure with complex unitary gates (e.g. RY, etc.)

Returns:

circuit (QuantumCircuit): Returns the MERA circuit generated with the help of the input arguments.

mera_simple(complex_structure: bool = True) QuantumCircuit

Builds a MERA circuit with a simple unitary gate parameterization.

Args:

complex_structure (bool): If True, builds the MERA structure with complex unitary gates (e.g. RY, etc.)

Returns:

circuit (QuantumCircuit): Returns the MERA circuit generated with the help of the input arguments.

piqture.tensor_networks.mps module

Matrix Product State Tensor Network (MPS)

class piqture.tensor_networks.mps.MPS(num_qubits: int)

Bases: BaseTensorNetwork

Implements a Matrix Product State (MPS) tensor network structure class.

References:

[1] H.-M. Rieser, F. Köster, and A. P. Raulf, “Tensor networks for quantum machine learning,” Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 479, no. 2275, p. 20230218, Jul. 2023, doi: https://doi.org/10.1098/rspa.2023.0218.

[2] D. Guala, S. Zhang, E. Cruz, C. A. Riofrío, J. Klepsch, and J. M. Arrazola, “Practical overview of image classification with tensor-network quantum circuits,” Scientific Reports, vol. 13, no. 1, p. 4427, Mar. 2023, doi: https://doi.org/10.1038/s41598-023-30258-y.

mps_backbone(gate_structure: Callable, param_vector_copy: ParameterVector, complex_structure: bool = True) QuantumCircuit

Lays out the MPS structure by progressively building layers of unitary gates with their alternative parameterization.

Args:

gate_structure (Callable): a callable function that implements either one of the three available unitary gate parameterization - simple, general or auxiliary.

param_vector_copy (ParameterVector): copy of the parameter vector list.

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.

mps_general(complex_structure: bool = True) QuantumCircuit

Implements an MPS network, as given in [1], with general alternative parameterization.

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.

mps_simple(complex_structure: bool = True) QuantumCircuit

Implements an MPS network, as given in [1], with simple alternative parameterization.

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by simple parameterization.

mps_with_aux(complex_structure: bool = True)

Implements an MPS network, as given in [1], with alternative parameterization that requires an auxiliary qubit.

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.

piqture.tensor_networks.peps module

piqture.tensor_networks.ttn module

Tree Tensor Network (TTN)

class piqture.tensor_networks.ttn.TTN(num_qubits: int)

Bases: BaseTensorNetwork

Implements a Tree Tensor Network (TTN) structure class with alternative unitary qubit parameterization.

References:

[1] E. Grant et al., “Hierarchical quantum classifiers,” npj Quantum Information, vol. 4, no. 1, Dec. 2018, doi: https://doi.org/10.1038/s41534-018-0116-9.

ttn_backbone(gate_structure: Callable, param_vector_copy: ParameterVector, complex_structure: bool = True) QuantumCircuit

Lays out the TTN structure by progressively building layers of unitary gates with their alternative parameterization.

Args:

gate_structure (Callable): a callable function that implements either one of the three available unitary gate parameterization - simple, general or auxiliary.

param_vector_copy (ParameterVector): copy of the parameter vector list.

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.

ttn_general(complex_structure: bool = True) QuantumCircuit

Implements a TTN network with general alternative parameterization as given in [1].

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.

ttn_simple(complex_structure: bool = True) QuantumCircuit

Implements a TTN network with simple alternative parameterization as given in [1].

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by simple parameterization.

ttn_with_aux(complex_structure: bool = True)

Implements a TTN network with alternative parameterization that requires an auxiliary qubit, as given in [1].

Args:

complex_structure (default=True): boolean marker for real or complex gate parameterization.

Returns:

QuantumCircuit: quantum circuit with unitary gates represented by general parameterization.