Tensor network simulation (qiskit_addon_aqc_tensor.simulation)

This module provides an interface to tensor-network simulation that is agnostic to which backend is used.

Currently, there is a single implementation, which uses the Qiskit Aer matrix-product state (MPS) simulator as its backend.

Available backends

Functions

The following functions provide a common interface that can be used with any supported backend. Regardless of which backend you use, you will invoke these functions as a common interface.

In each function below, the documentation shows every distinct implementation available for that function. The addon will choose which implementation to use based on the types of the arguments that you provide. (This paradigm is called “multiple dispatch”.)

tensornetwork_from_circuit(qc, settings, /)[source]

Create a tensor-network state by simulating a quantum circuit.

The type of tensor-network state will correspond to the type of the settings object. For instance, a QiskitAerSimulationSettings will result in this function returning a QiskitAerMPS.

tensornetwork_from_circuit(qc: qiskit.circuit.quantumcircuit.QuantumCircuit, settings: qiskit_addon_aqc_tensor.simulation.aer.simulation.QiskitAerSimulationSettings | plum.type.ModuleType[qiskit_aer.AerSimulator], /, *, out_state: numpy.ndarray | None = None) qiskit_addon_aqc_tensor.simulation.aer.state.QiskitAerMPS[source]
Parameters:
Return type:

TensorNetworkState

tensornetwork_from_circuit(qc: qiskit.circuit.quantumcircuit.QuantumCircuit, settings: qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator, /) quimb.tensor.Circuit[source]
Parameters:
Return type:

TensorNetworkState

Return type:

TensorNetworkState

Parameters:
apply_circuit_to_state(qc, psi, settings, /, *, out_state=None)[source]

Apply a quantum circuit to a tensor network state.

The input state (psi) is not modified.

Return type:

TensorNetworkState

Returns:

The new state.

Parameters:
apply_circuit_to_state(qc: qiskit.circuit.quantumcircuit.QuantumCircuit, psi: qiskit_addon_aqc_tensor.simulation.aer.state.QiskitAerMPS, settings: qiskit_addon_aqc_tensor.simulation.aer.simulation.QiskitAerSimulationSettings | plum.type.ModuleType[qiskit_aer.AerSimulator], /, *, out_state: numpy.ndarray | None = None) qiskit_addon_aqc_tensor.simulation.aer.state.QiskitAerMPS[source]
Parameters:
Return type:

TensorNetworkState

apply_circuit_to_state(qc: qiskit.circuit.quantumcircuit.QuantumCircuit, circ0: plum.type.ModuleType[quimb.tensor.Circuit], settings: qiskit_addon_aqc_tensor.simulation.quimb.QuimbSimulator, /, *, out_state: numpy.ndarray | None = None) quimb.tensor.Circuit[source]
Parameters:
Return type:

TensorNetworkState

Apply a quantum circuit to a tensor network state.

The input state (psi) is not modified.

Returns:

The new state.

Parameters:
Return type:

TensorNetworkState

compute_overlap(psi_1, psi_2, /)[source]

Compute overlap of two quantum states: \(\langle \psi_1 | \psi_2 \rangle\).

NOTE: Unlike numpy.dot, implementations of this method will perform complex conjugation on the first argument.

Parameters:
Return type:

complex

Returns:

complex dot product value.

compute_overlap(mps1: qiskit_addon_aqc_tensor.simulation.aer.state.QiskitAerMPS, mps2: qiskit_addon_aqc_tensor.simulation.aer.state.QiskitAerMPS, /) complex[source]
Parameters:
Return type:

complex

compute_overlap(circ1: plum.type.ModuleType[quimb.tensor.Circuit], circ2: plum.type.ModuleType[quimb.tensor.Circuit], /) complex[source]
Parameters:
Return type:

complex

Abstract classes

These are abstract classes, implemented by each backend.

class TensorNetworkState[source][source]

Bases: object

Abstract tensor network state.

class TensorNetworkSimulationSettings[source][source]

Bases: object

Abstract truncation settings.