quri_parts.tensornetwork.circuit package

TensorNetworkTranspiler()

CircuitTranspiler to convert a circit configuration suitable for tensornetwork.

class TensorNetworkLayer(input_edges, output_edges, container, layer_tensor_map)

Bases: NodeCollection

Tensor network representation of a quantum circuit and operators.

This class subclasses NodeCollection and provides input and output edges for the circuit/operator, each of which represents a qubit.

Parameters:
  • input_edges (Sequence[Edge])

  • output_edges (Sequence[Edge])

  • container (Union[set[AbstractNode], list[AbstractNode]])

  • layer_tensor_map (list[dict[int, AbstractNode]])

copy()

Returns a copy of itself.

Return type:

TensorNetworkLayer

extend(other, *varargs, **kwargs)
Parameters:
Return type:

TensorNetworkLayer

connect_layers(first, second)
Parameters:
Return type:

TensorNetworkLayer

connect_gate(node, qubits, qubit_count, depth, tensor_map, in_out_map)
Parameters:
Return type:

None

add_disconnected_qubits(in_out_map, node_collection, tensor_map)
Parameters:
  • in_out_map (Sequence[dict[str, Edge | None]])

  • node_collection (NodeCollection)

  • tensor_map (list[dict[int, TensorNetworkQuantumGate]])

Return type:

None

convert_circuit(circuit, transpiler=<quri_parts.circuit.transpile.transpiler.SequentialTranspiler object>, backend='numpy')

Convert an ImmutableQuantumCircuit to a tensornetwork NodeCollection.

Parameters:
  • circuit (ImmutableQuantumCircuit) – the quantum circuit to convert to a node collection

  • transpiler (circuit.transpile.transpiler.CircuitTranspiler | None) – optional transpiler to use

  • backend (str)

Return type:

TensorNetworkLayer

Submodules