Math¶
per(mtx, column, selected, prod, output=False)
¶
Row expansion for the permanent of matrix mtx. The counter column is the current column, selected is a list of indices of selected rows, and prod accumulates the current product.
Source code in src/squint/ops/math.py
permanent(mat)
¶
get_fixed_sum_tuples(length, total)
¶
Generate all tuples of a given length that sum to a specified total.
Source code in src/squint/ops/math.py
compile_Aij_indices(i_s: jnp.array, j_s: jnp.array, m: int, n: int)
¶
Compile all indices for generating the \(A_{ij}\) matrices for all i and j combinations.
Source code in src/squint/ops/math.py
compute_transition_amplitudes(unitary: jnp.array, transition_inds: jnp.array)
¶
Calculates all i -> j transition amplitudes in a jit-able manner.
Source code in src/squint/ops/math.py
The code for the gellman
function is adapted from the PySME project,
which is licensed under the MIT license.
Source: https://pysme.readthedocs.io/en/latest/_modules/gellmann.html .. module:: gellmann.py :synopsis: Generate generalized Gell-Mann matrices .. moduleauthor:: Jonathan Gross jarthurgross@gmail.com
Functions to generate the generalized Pauli (i.e., Gell-Mann matrices)
gellmann(j, k, d)
¶
Returns a generalized Gell-Mann matrix of dimension d. According to the
convention in Bloch Vectors for Qubits by Bertlmann and Krammer (2008),
returns :math:\Lambda^j
for :math:1\leq j=k\leq d-1
,
:math:\Lambda^{kj}_s
for :math:1\leq k<j\leq d
,
:math:\Lambda^{jk}_a
for :math:1\leq j<k\leq d
, and
:math:I
for :math:j=k=d
.
:param j: First index for generalized Gell-Mann matrix :type j: positive integer :param k: Second index for generalized Gell-Mann matrix :type k: positive integer :param d: Dimension of the generalized Gell-Mann matrix :type d: positive integer :returns: A genereralized Gell-Mann matrix. :rtype: numpy.array