#### Previous topic

Harmonic oscillators (qit.ho)

#### Next topic

Born-Markov noise (qit.markov)

# Local invariants (qit.invariant)¶

This module contains tools for computing and plotting the values of various local gate and state invariants.

## Contents¶

 LU(rho, k, perms) Local unitary polynomial invariants of quantum states. canonical(U) Canonical local invariants of a two-qubit gate. makhlin(U) Makhlin local invariants of a two-qubit gate. max_concurrence(U) Maximum concurrence generated by a two-qubit gate. plot_makhlin_2q([sdiv, tdiv]) Plots the set of two-qubit gates in the space of Makhlin invariants. plot_weyl_2q([ax]) Plots the two-qubit Weyl chamber.
qit.invariant.canonical(U)

Canonical local invariants of a two-qubit gate.

Returns a vector of three real canonical local invariants for the U(4) matrix U, normalized to the range [0,1]. Uses the algorithm in [4].

qit.invariant.makhlin(U)

Makhlin local invariants of a two-qubit gate.

Returns a vector of the three real Makhlin invariants (see [14]) corresponding to the U(4) gate U.

Alternatively, given a vector of canonical invariants normalized to [0, 1], returns the corresponding Makhlin invariants (see [24]).

qit.invariant.max_concurrence(U)

Maximum concurrence generated by a two-qubit gate.

Returns the maximum concurrence generated by the two-qubit gate U (see [12]), starting from a tensor state.

Alternatively, U may be given in terms of a vector of three canonical local invariants.

qit.invariant.plot_weyl_2q(ax=None)

Plots the two-qubit Weyl chamber.

Plots the Weyl chamber for the local invariants of 2q gates. See [24].

Returns the Axes3D object.

qit.invariant.plot_makhlin_2q(sdiv=31, tdiv=31)

Plots the set of two-qubit gates in the space of Makhlin invariants.

Plots the set of two-qubit gates in the space of Makhlin invariants (see makhlin), returns the Axes3D object.

The input parameters are the s and t divisions of the mesh.

qit.invariant.LU(rho, k, perms)

Local unitary polynomial invariants of quantum states.

Computes the permutation invariant for the state . perms is a tuple containing n k-permutation tuples.

Example: = LU_inv(rho, 3, [(1, 2, 0), (1, 0, 2)])

This function can be very inefficient for some invariants, since it does no partial traces etc. which might simplify the calculation.

Uses the algorithm in [2].