qml.structure_constants

structure_constants(g, pauli=False)[source]

Compute the structure constants that make up the adjoint representation of a Lie algebra.

Given a DLA \(\{iG_1, iG_2, .. iG_d \}\) of dimension \(d\), the structure constants yield the decomposition of all commutators in terms of DLA elements,

\[[i G_\alpha, i G_\beta] = \sum_{\gamma = 0}^{d-1} f^\gamma_{\alpha, \beta} iG_\gamma.\]

The adjoint representation \(\left(\text{ad}(iG_\gamma)\right)_{\alpha, \beta} = f^\gamma_{\alpha, \beta}\) is given by those structure constants, which can be computed via

\[f^\gamma_{\alpha, \beta} = \frac{\text{tr}\left(i G_\gamma \cdot \left[i G_\alpha, i G_\beta \right] \right)}{\text{tr}\left( iG_\gamma iG_\gamma \right)}.\]

Note that this is just the projection of the commutator on the DLA element \(iG_\gamma\) via the trace inner product. The inputs are assumed to be orthogonal. However, we neither assume nor enforce normalization of the DLA elements \(G_\alpha\), hence the normalization factor \(\text{tr}\left( iG_\gamma iG_\gamma \right)\) in the projection.

Parameters
  • g (List[Union[Operator, PauliWord, PauliSentence]]) – The (dynamical) Lie algebra for which we want to compute its adjoint representation. DLAs can be generated by a set of generators via lie_closure().

  • pauli (bool) – Indicates whether it is assumed that PauliSentence or PauliWord instances are input. This can help with performance to avoid unnecessary conversions to Operator and vice versa. Default is False.

Returns

The adjoint representation of shape (d, d, d), corresponding to indices (gamma, alpha, beta).

Return type

TensorLike

Example

Let us generate the DLA of the transverse field Ising model using lie_closure().

>>> n = 2
>>> gens = [X(i) @ X(i+1) for i in range(n-1)]
>>> gens += [Z(i) for i in range(n)]
>>> dla = qml.lie_closure(gens)
>>> print(dla)
[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))]

The dimension of the DLA is \(d = 6\). Hence, the structure constants have shape (6, 6, 6).

>>> adjoint_rep = qml.structure_constants(dla)
>>> adjoint_rep.shape
(6, 6, 6)

The structure constants tell us the commutation relation between operators in the DLA via

\[[i G_\alpha, i G_\beta] = \sum_{\gamma = 0}^{d-1} f^\gamma_{\alpha, \beta} iG_\gamma.\]

Let us confirm those with an example. Take \([iG_1, iG_3] = [iZ_0, -iY_0 X_1] = -i 2 X_0 X_1 = -i 2 G_0\), so we should have \(f^0_{1, 3} = -2\), which is indeed the case.

>>> adjoint_rep[0, 1, 3]
-2.0

We can also look at the overall adjoint action of the first element \(G_0 = X_{0} \otimes X_{1}\) of the DLA on other elements. In particular, at \(\left(\text{ad}(iG_0)\right)_{\alpha, \beta} = f^0_{\alpha, \beta}\), which corresponds to the following matrix.

>>> adjoint_rep[0]
array([[ 0.,  0.,  0.,  0.,  0.,  0.],
       [-0.,  0.,  0., -2.,  0.,  0.],
       [-0.,  0.,  0.,  0., -2.,  0.],
       [-0.,  2., -0.,  0.,  0.,  0.],
       [-0., -0.,  2.,  0.,  0.,  0.],
       [ 0., -0., -0., -0., -0.,  0.]])

Note that we neither enforce nor assume normalization by default.