Classification of Pauli DLAs#

This tutorial will illustrate how to use paulie to classify the dynamical Lie algebra of a circuit given the generators consisting of Pauli strings. A Pauli string is a tensor product of Pauli matrices

\[P = \bigotimes_i \sigma_i , \, \sigma_i \in \{I,X,Y,Z\}\]

and is represented as a string indicating the Pauli matrices successively. Given a set of Pauli strings, the closure under the commutator defines a Lie algebra.

In Aguilar et al. [2024], an efficient algorithm for classifying which Lie algebra is generated is given. PauLie implements a modified version of this algorithm. The function get_algebra returns exactly which algebra is generated when given the generator set which can be extended with identities to arbitrary qubit numbers specified. We can reproduce Example I.5 in Wiersema et al. [2024]:

from paulie import get_pauli_string as p

generators = p(["XY"])
algebra = generators.get_algebra()
print(f"algebra = {algebra}")

outputs

algebra = u(1)

whereas changing to a three qubit system, results in another algebra:

size = 3
generators = p(["XY"], n=size)
algebra = generators.get_algebra()
print(f"algebra = {algebra}")

outputs

algebra = so(3)

The algorithm is based on the concept of an anticommutation graph. Given a set of n-qubit Pauli strings \(\mathcal{G} = \{P_1,\dots ,P_{n_G}\}\), the anticommutation graph has as a vertex set \(\mathcal{G}\) and edges between all vertices that do not commute. Starting with an empty generator set, we incrementally add Pauli strings to our set. At each step, we must keep the anticommutation graph in a canonical form (explained later). The fundamental operation we use is a contraction between two Pauli strings \(P_i\) and \(P_j\) which maps \(P_i \mapsto \pm \frac{1}{2} i [P_i,P_j] = P_i^\star\). Crucially, it can be shown that this operation leaves the Lie algebra invariant. Now if \(P_i^\star\) is already in \(\mathcal{G}\), the size of the generator set has been reduced. Otherwise, the operation results the complementation of the edge set between \(P_i^\star\) and vertices in the neighbourhood of \(P_j\). Simply put, we can use such contractions to manipulates the edges of the anticommutation graph so as to bring it to a canonical form.

For any generator set consisting of Pauli strings, the anticommutation graph can be transformed to four canonical types (Theorem 1 in Aguilar et al. [2024]). Each canonical type corresponds to a particular algebra. There is an exception if \(\mathcal{P}\) only has one Pauli string. A single Pauli string generates the algebra \(\mathfrak{u}(1)\).

Canonical types and associated Lie algebras for a starlike graph with \(n_1 + 1\) \(\left(n_1 \geq 0\right)\) legs of length \(1\) and \(n_2\) \(\left(n_2 \geq 1\right)\) legs of length \(2\). Note that some graphs may belong to multiple canonical types, which reflects the existence of certain exceptional isomorphisms between Lie algebras.#

Canonical type

Structure

Lie algebra

A

\(\left|N\right| = n_1\), \(\left|T\right| = 0\), \(\left|L^{\mathcal{B}}\right| = n\)

\(\bigoplus_{i=1}^{2^{n_1}}\mathfrak{so}(n + 3)\)

B1

\(\left|N\right|=n_1\), \(\left|T\right| = n_2\), \(\left|L^{\mathcal{B}}\right|=0\)

\(\bigoplus_{i=1}^{2^{n_1}}\mathfrak{sp}(2^{n_2})\)

B2

\(\left|N\right|=n_1\), \(\left|T\right| = n_2\), \(\left|L^{\mathcal{B}}\right|=4\)

\(\bigoplus_{i=1}^{2^{n_1}}\mathfrak{so}(2^{n_2 + 3})\)

B3

\(\left|N\right|=n_1\), \(\left|T\right| = n_2\), \(\left|L^{\mathcal{B}}\right|=3\)

\(\bigoplus_{i=1}^{2^{n_1}}\mathfrak{su}(2^{n_2 + 2})\)

All four canonical types are starlike graphs. The algorithm essentially proceeds by first creating a “core” of vertices (the central vertex of the star and at most two other vertices), and then appending vertices to legs or splitting legs and connecting them to the center, as required. There are essentially four key steps:

  • Step 1: Build the core.

  • Step 2: If the vertex to be added is only connected to a subset of the isolated (only connected to center excluding the vertex to be added) vertices, use contractions until it is only connected to one isolated vertex and exit. Otherwise use contractions to disconnect the isolated vertices from the vertex to be added and go to Step 3.

  • Step 3: Use contractions until the vertex is only connected to vertices on the longest leg of the graph.

  • Step 4: Use contractions until we can attach the vertex to the end of the longest leg or to the center. This step cannot always be achieved using just contractions: we may have to remove a vertex to complete this step. But it is fine since we can add it again afterwards without affecting the algebra.

Classification of A-type canonical graph#

Let’s try to classify a generator set that corresponds to an A-type canonical graph. This algebra is generated by \(\mathcal{P}=\{IYZI,IIXX,IIYZ,IXXI,XXII,YZII\}\).

generators = p(["IYZI", "IIXX", "IIYZ", "IXXI", "XXII", "YZII"])
algebra = generators.get_algebra()
print(f"algebra = {algebra}")

outputs

algebra = 4*so(5)

We can also animate the transformation to a canonical graph. We use the following color convention.

Node Color
Lighting
Dependent
Unlit vertex in a leg of length one
Removing
Unlit
Appending
Contracting
Lit vertex in a leg of length one
Replacing
Lit

This is what happens:

  1. \(IYZI\) is added.

  2. \(IIXX\) is added as one leg.

  3. \(IIYZ\) is added as the second leg. Now the core is complete.

  4. \(IXXI\) is added. It is connected to \(IIYZ\).

  5. \(XXII\) is added. It is connected to \(IYZI\).

  6. \(YZII\) is added. It is connected to \(IYZI\) and \(IXXI\). We are now in Step 4. But the configuration of attached vertices is such that we must remove \(IXXI\) so that it is valid for us to attach \(YZII\) to \(IYZI\).

  7. Now we must add \(IXXI\) again. It is connected to \(YZII\) and \(IIYZ\). We are now in Step 2. In this case, we pick two isolated vertices \(P\) and \(Q\) such that \(P\) is connected to the vertex to be added and \(Q\) is not. Then for every remaining vertex \(W\) which is connected to the vertex to be added, we perform \(W\mapsto PQW\) and now \(PQW\) commutes with the vertex to be added, so it is no longer connected. It is guaranteed that such a transformation is always possible by Theorem 4 of Aguilar et al. [2024]. In our case, we can pick \(P=YZII\) and \(Q=XXII\), which means we have \(IIYZ\mapsto ZYYZ\) and then we can connect \(IXXI\) to \(YZII\).

According to the table, the resultant graph corresponds to \(\mathfrak{so}(5)\oplus \mathfrak{so}(5)\oplus \mathfrak{so}(5)\oplus \mathfrak{so}(5)\). But it is worth noting that it also corresponds to \(\mathfrak{sp}(2)\oplus \mathfrak{sp}(2)\oplus \mathfrak{sp}(2)\oplus \mathfrak{sp}(2)\). This shows that there is an exceptional isomorphism between \(\mathfrak{so}(5)\) and \(\mathfrak{sp}(2)\).

Classification of B-type canonical graph#

Let’s try to classify a generator set that corresponds to a B-type canonical graph, that is a anticommutation graph that is a star graph. We demonstrate it by the algebra \(\mathfrak{a}_9\) [1], generated by \(XY\) and \(XZ\).

n_qubits = 4
generators = p(["XY", "XZ"], n=n_qubits)
algebra = generators.get_algebra()
print(f"algebra = {algebra}")

outputs

algebra = sp(4)

We can also animate the transformation to a star graph:

This is what happens:

  1. \(IXZI\) is added.

  2. \(IIXZ\) is added as one leg.

  3. \(IIXY\) is added. It is connected to \(IXZI\) and \(IIXZ\), so we contract with \(IXZI\) to get \([IXZI, IIXY]\propto IXYY\). We add it as the second leg. Now the core is complete.

  4. \(IXYI\) is added. It is connected to \(IXZI\) and \(IIXZ\). We are now in Step 2. We pick \(P=IIXZ\) and \(Q=IXYY\) and we get \(IXZI\mapsto IIIX\). Then we can attach \(IXYI\) to \(IIXZ\).

  5. \(XZII\) is added. It is connected to \(IXYY\) and \(IXYI\). We are now in Step 2. We can contract with \(IXYY\) and \(IIIX\) in that order to get \([IIIX,[IXYY,XZII]]\propto XYYZ\). Now it is connected to \(IIIX\), \(IIXZ\), and \(IXYI\). Now we are in Step 4 of the algorithm. We can contract with \(IXYI\) to get \([IXYI,XYYZ]\propto XZIZ\). Now it is no longer connected to \(IIXZ\). Next we contract with \(IIIX\) to get \([IIIX,XZIZ]\propto XZIY\). Now \(XZIY\) is connected to all vertices. Then we contract with \(IXYY\) to get \([IXYY,XZIY]\propto XYYI\). Now it is connected to all except \(IIIX\). Then we contract with \(IIXZ\) to get \([IIXZ,XYYI]\propto XYZZ\). Now it is connected to all except \(IXYI\). Finally, we contract with \(IIIX\) to get \([IIIX,XYZZ]\propto XYZY\). Now it is attached to only \(IIIX\). We can consider \(IIIX\) as the center.

  6. \(XYII\) is added. It is connected to \(IXYY\) and \(IXYI\). We are now in Step 2. We pick \(P=IXYY\) and \(Q=XYZY\) and we get \(IXYI\mapsto XYZI\). Then we can attach \(XYII\) to \(IXYY\).

According to the table, the resultant graph corresponds to \(\mathfrak{sp}(4)\).

The Lie algebra plays a pivotal role in quantum control theory to understand the reachability of states. Also measures of operator spread complexity rely on this concept. Furthermore, determining moments of circuits can be significantly simplified when the Lie algebra is known. All these applications are functionalities of paulie.