qml.liealg.check_cartan_decomp¶
- check_cartan_decomp(k, m, verbose=True)[source]¶
Helper function to check the validity of a Cartan decomposition g=k⊕m.
Check whether of not the following properties are fulfilled.
[k,k]⊆k (subalgebra)[k,m]⊆m (reductive property)[m,m]⊆k (symmetric property)Warning
This function is expensive to compute
- Parameters
k (List[Union[PauliSentence, TensorLike]]) – List of operators of the vertical subspace.
m (List[Union[PauliSentence, TensorLike]]) – List of operators of the horizontal subspace.
verbose – Whether failures to meet one of the criteria should be printed.
- Returns
Whether or not all of the Cartan commutation relations are fulfilled.
- Return type
bool
See also
Example
We first construct a Lie algebra.
>>> from pennylane import X, Z >>> from pennylane.liealg import concurrence_involution, even_odd_involution, cartan_decomp >>> generators = [X(0) @ X(1), Z(0), Z(1)] >>> g = qml.lie_closure(generators) >>> g [X(0) @ X(1), Z(0), Z(1), -1.0 * (Y(0) @ X(1)), -1.0 * (X(0) @ Y(1)), -1.0 * (Y(0) @ Y(1))]
We compute the Cartan decomposition with respect to the
concurrence_involution()
.>>> k, m = cartan_decomp(g, concurrence_involution) >>> k, m ([-1.0 * (Y(0) @ X(1)), -1.0 * (X(0) @ Y(1))], [X(0) @ X(1), Z(0), Z(1), -1.0 * (Y(0) @ Y(1))])
We can check the validity of the decomposition using
check_cartan_decomp
.>>> from pennylane.liealg import check_cartan_decomp >>> check_cartan_decomp(k, m) True