piel.tools.qutip.unitary#

Attributes#

Functions#

matrix_to_qutip_qobj(s_parameters_standard_matrix)

This function converts the calculated S-parameters into a standard Unitary matrix topology so that the shape and

subunitary_selection_on_index(unitary_matrix, ...)

This function returns a unitary between the indexes selected, and verifies the indexes are valid by checking that

subunitary_selection_on_range(unitary_matrix, stop_index)

This function returns a unitary between the indexes selected, and verifies the indexes are valid by checking that

verify_matrix_is_unitary(→ bool)

Verify that the matrix is unitary.

Module Contents#

matrix_to_qutip_qobj(s_parameters_standard_matrix: jax.numpy.ndarray)[source]#

This function converts the calculated S-parameters into a standard Unitary matrix topology so that the shape and dimensions of the matrix can be observed.

I think this means we need to transpose the output of the filtered sax SDense matrix to map it to a QuTip matrix. Note that the documentation and formatting of the standard sax mapping to a S-parameter standard notation is already in described in piel/piel/sax/utils.py.

From this stage we can implement a QObj matrix accordingly and perform simulations accordingly. https://qutip.org/docs/latest/guide/qip/qip-basics.html#unitaries

For example, a qutip representation of an s-gate gate would be:

..code-block:

import numpy as np
import qutip
# S-Gate
s_gate_matrix = np.array([[1.,   0], [0., 1.j]])
s_gate = qutip.Qobj(mat, dims=[[2], [2]])

In mathematical notation, this S-gate would be written as:

..math:

S = \begin{bmatrix}
    1 & 0 \\
    0 & i \\
\end{bmatrix}
Parameters:

s_parameters_standard_matrix (nso.ndarray) – A dictionary of S-parameters in the form of a SDict from sax.

Returns:

A QuTip QObj representation of the S-parameters in a unitary matrix.

Return type:

qobj_unitary (qutip.Qobj)

subunitary_selection_on_index(unitary_matrix: jax.numpy.ndarray, rows_index: jax.numpy.ndarray | tuple, columns_index: jax.numpy.ndarray | tuple)[source]#

This function returns a unitary between the indexes selected, and verifies the indexes are valid by checking that the output matrix is also a unitary.

TODO implement validation of a 2D matrix.

subunitary_selection_on_range(unitary_matrix: jax.numpy.ndarray, stop_index: tuple, start_index: tuple | None = (0, 0))[source]#

This function returns a unitary between the indexes selected, and verifies the indexes are valid by checking that the output matrix is also a unitary.

TODO implement validation of a 2D matrix.

verify_matrix_is_unitary(matrix: jax.numpy.ndarray) bool[source]#

Verify that the matrix is unitary.

Parameters:

matrix (jnp.ndarray) – The matrix to verify.

Returns:

True if the matrix is unitary, False otherwise.

Return type:

bool

standard_s_parameters_to_qutip_qobj#