pauli_kronecker_product

Graph.pauli_kronecker_product(labels, subsystem_count, *, name=None)

Place Pauli matrices into their two-dimensional subsystems of a system and returns the Kronecker product.

Parameters

  • labels (list [ tuple [ str , int ] ]) – A list of tuples, each containing a pair of labels for the Pauli matrix and its position. The Pauli matrix label is a string 'I', 'X', 'Y', 'Z', 'M', or 'P' and the position label is a non-negative integer and smaller than system_count indicating the position of the Pauli matrix in the system. At least one tuple must be provided. 'M' creates the lowering matrix σ=12(σx+iσy)\sigma_- = \frac{1}{2}(\sigma_x + i\sigma_y). 'P' creates the raising matrix σ+=12(σxiσy)\sigma_+ = \frac{1}{2}(\sigma_x - i\sigma_y). We use the convention |\downarrow\rangle = \begin{bmatrix}1\0\end{bmatrix} and |\uparrow\rangle = \begin{bmatrix}0\1\end{bmatrix}.
  • subsystem_count (int) – The number of two-level subsystems that constitute the system. Must be a positive number.
  • name (str or None , optional) – The name of the node.

Returns

The Kronecker product of Pauli matrices.

Return type

Tensor

SEE ALSO

Graph.embed_operators : Embed operators into a larger Hilbert space.

Graph.kron : Kronecker product between two objects.

Graph.kronecker_product_list : Kronecker product of a list of operators.

Examples

Place a single Pauli XX matrix in the second of two subsystems to create IXIX.

>>> graph.pauli_kronecker_product([("X", 1)], subsystem_count=2, name="IX")
<Tensor: name="IX", operation_name="pauli_kronecker_product", shape=(4, 4)>
>>> result = bo.execute_graph(graph=graph, output_node_names="IX")
>>> result["output"]["IX"]["value"]
array([[0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j],
       [1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j]])

Place a single Pauli XX matrix in the second of three subsystems to create IXIIXI.

>>> graph.pauli_kronecker_product([("X", 1)], subsystem_count=3, name="IXI")
<Tensor: name="IXI", operation_name="pauli_kronecker_product", shape=(8, 8)>
>>> result = bo.execute_graph(graph=graph, output_node_names="IXI")
>>> result["output"]["IXI"]["value"]
array([[0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       ...
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j]])

Place two Pauli XX matrices in the second and third of three subsystems to create IXXIXX.

>>> graph.pauli_kronecker_product([("X", 1), ("X", 2)], subsystem_count=3, name="IXX")
<Tensor: name="IXX", operation_name="pauli_kronecker_product", shape=(8, 8)>
>>> result = bo.execute_graph(graph=graph, output_node_names="IXX")
>>> result["output"]["IXX"]["value"]
array([[0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
       ...
       [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]])

Was this useful?