<p>For the case of Hamiltonians, rather than gates the answer is trivially yes: you simply enumerate the independent elements of the Lie algebra. Since the Lie algebra is a vector space with the addition of the Lie bracket operator. Since the space is finite, it has a finite basis, and which can easily be checked as to whether it is closed or open under the Lie bracket operation. Simply checking the Lie bracket of all pairs of orthogonal operators can be done in time polynomial in the dimensionality of the space, and a suitable operator basis can be found by the Gram-Schmidt method.</p>

<p>For gates, you don't really have the same option to resort to infinitesimals straight off, and need to construct gates with irrational eigenvalues so that you can arbitrarily well approximate the required infinitesimal generators. I guess that there is a relatively simple way to do this, but it is not immediately obvious to me. </p>

<p>In any case, taking the log of the gates to obtain a set of operators which generate them when exponentiated and checking whether these generated the full Lie algebra would provide a simple necessary but not sufficient criteria for universality.</p>

CC BY-SA 3.0
2012-01-20T20:40:38.490Z
Why we should check only pairs?
Alex 'qubeat'
CC BY-SA 3.0
2012-01-21T02:41:45.737Z
@AlexV: Because the Lie bracket takes operates on 2 inputs. Every time you produce a new linearly independent operator you produce an orthogonal one and repeat until you get closure.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-21T12:35:46.010Z
I meant you should consider $[\ldots[H_k,H_j],H_l],\ldots]$, but not only pairs, e.g. see my own paper http://arxiv.org/abs/quant-ph/0010071
Alex 'qubeat'
CC BY-SA 3.0
2012-01-21T14:25:49.510Z
@AlexV: You don't need to. It's a vector space, so a vector is orthogonal to a given subspace if and only if it is orthogonal to any basis for that subspace.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-21T15:54:06.263Z
Likely we are talking about different things - which vector space you are talking about? You do not know from very beginning the subalgebra generated by your gates - you need to construct that from given Hamiltonians to check if it whole Lie algebra.
Alex 'qubeat'
CC BY-SA 3.0
2012-01-21T16:09:12.873Z
There is yet another problem - I think, using example of non-universal set of gates discussed in my paper (and in many other places) we may construct example, then changing a gate on arbitrary small value may convert set to universal.
Alex 'qubeat'
CC BY-SA 3.0
2012-01-21T20:38:24.933Z
@AlexV: The Lie algebra is a vector space together with a Lie Bracket operator. I'm using the fact that it is a vector space which has a maximum dimension, and hence you can impose a basis on it. If this is closed under the Lie bracket, then taking Lie brackets of Lie brackets will still result in the same space. Only if it is not close will higher order terms play a role. However, if you check, and find that the Lie bracket gives you vectors outside the space, you simply form a new basis using these and the old basis via Gram-Schmidt, and repeat.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-21T20:40:28.843Z
@AlexV: This is implicitly including the higher order terms, whenever the Lie bracket gives you a vector linearly independent of the previous ones. I simply chose to write it as a recursive process considering only pairs each time, since this makes it obvious that the process must terminate in finite time, due to the finite dimension of the space (and hence finite number of recursions). This is akin to saying that we do one round in which we consider higher order terms, but only up to the $d^2$ terms deep (where $d$ is the dimension of the Hilbert space).
Joe Fitzsimons
CC BY-SA 3.0
2012-01-22T14:14:11.583Z
O'K. But you should agree, that such process has exponential complexity with respect to number of qubits (and gates, if the numbers are proportional one). Now if we have some exotic set of gates and need to know if it is universal for any number of qubits, why such a problem should necessary be decidable?
Alex 'qubeat'
CC BY-SA 3.0
2012-01-22T17:15:57.117Z
@AlexV: Yes, absolutely it does have exponential time complexity in the number of qubits (but polynomial in the dimensionality of the space), but the point is that there is an exponential time algorithm for the Hamiltonian version of the problem. For gates, I'm not sure that this is still true, but I suspect it is. I think that you can probably approximate Hamiltonians via Solovay-Kitaev or decide that the group is finite in some bounded time, but this is conjecture. However, taking the log of the gates gives you a necessary but not sufficient criteria for universality.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-22T17:18:00.250Z
@AlexV: I should point out, however, that there is often a polynomial time algorithm. Daniel Burgarth and Alastair Kay have both done a fair amount of work on this problem for restricted types of Hamiltonians.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-23T10:45:25.087Z
I did not see a work of Daniel Burgarth and Alastair Kay on the particular theme, but in works of other authors most often appear the same $spin(n)$ theme, but it is necessary some time, to check the isomorphism. Anyway, in many classical problems we should consider $n \to \infty$ to lost decidability.
Alex 'qubeat'
CC BY-SA 3.0
2012-01-20T16:59:46.147Z
2012-01-20T16:59:46.147Z
Joe Fitzsimons
<p>Given a finite set of quantum gates $\mathcal{G} = \{G_1, \dots, G_n\}$, is it decidable (in computation theoretic sense) whether $\mathcal{G}$ is a universal gate set? On one hand, "almost all" gate sets are universal, on the other, non-universal gate sets are still not well understood (in particular, of course, it is not known whether every non-universal gate set is classically simulatable), so I imagine giving an explicit algorithm for checking universality could be nontrivial. </p>

CC BY-SA 3.0
2012-01-31T06:19:28.183Z
@DanielGottesman: I agree about the limitations of my answer. Indeed, I believe it is undecidable in the latter case as follows: Take a cellular automata on an infinite lattice of qubits and use it to encode the halting problem (call this update unitary $U_1$). Then take a second lattice with a universal QCA (with update unitary $U_2$). We can define a new unitary $CU_2 = |0\rangle\langle0|_H\otimes I + |1\rangle\langle1|\otimes U_2$, where the subscript $H$ denotes a qubit which is set to $|1\rangle$ iff the first cellular automata halts.
Joe Fitzsimons
CC BY-SA 3.0
2012-01-31T06:22:37.413Z
Thus the gate $CU_2 \times U_1$ is universal if and only if the first Turing machine halts, and is hence undecidable.
Joe Fitzsimons
CC BY-SA 4.0
2023-06-04T22:14:14.603Z
I asked a related question on quantum computing stack exchange recently. https://quantumcomputing.stackexchange.com/questions/32408/can-you-programatically-check-whether-a-given-set-of-gates-is-universal
Callum
<quantum-computing>
Decidability/algorithm for checking universality of a quantum gate set
Marcin Kotowski
# Decidability/algorithm for checking universality of a quantum gate set

(Asked by: username_0 on 2012-01-20)

Given a finite set of quantum gates $\mathcal{G} = \{G\_1, \dots, G\_n\}$, is it decidable (in computation theoretic sense) whether $\mathcal{G}$ is a universal gate set? On one hand, "almost all" gate sets are universal, on the other, non-universal gate sets are still not well understood (in particular, of course, it is not known whether every non-universal gate set is classically simulatable), so I imagine giving an explicit algorithm for checking universality could be nontrivial.

**Tags:** quantum-computing
> **Comments:**
> **username_1**: @DanielGottesman: I agree about the limitations of my answer. Indeed, I believe it is undecidable in the latter case as follows: Take a cellular automata on an infinite lattice of qubits and use it to encode the halting problem (call this update unitary $U_1$). Then take a second lattice with a universal QCA (with update unitary $U_2$). We can define a new unitary $CU_2 = |0\rangle\langle0|_H\otimes I + |1\rangle\langle1|\otimes U_2$, where the subscript $H$ denotes a qubit which is set to $|1\rangle$ iff the first cellular automata halts.  
> **username_1**: Thus the gate $CU_2 \times U_1$ is universal if and only if the first Turing machine halts, and is hence undecidable.  
> **username_2**: I asked a related question on quantum computing stack exchange recently. https://quantumcomputing.stackexchange.com/questions/32408/can-you-programatically-check-whether-a-given-set-of-gates-is-universal  

---

## 1 answers

### Answer by username_1 on 2012-01-20. Score: 9

For the case of Hamiltonians, rather than gates the answer is trivially yes: you simply enumerate the independent elements of the Lie algebra. Since the Lie algebra is a vector space with the addition of the Lie bracket operator. Since the space is finite, it has a finite basis, and which can easily be checked as to whether it is closed or open under the Lie bracket operation. Simply checking the Lie bracket of all pairs of orthogonal operators can be done in time polynomial in the dimensionality of the space, and a suitable operator basis can be found by the Gram-Schmidt method.

For gates, you don't really have the same option to resort to infinitesimals straight off, and need to construct gates with irrational eigenvalues so that you can arbitrarily well approximate the required infinitesimal generators. I guess that there is a relatively simple way to do this, but it is not immediately obvious to me.

In any case, taking the log of the gates to obtain a set of operators which generate them when exponentiated and checking whether these generated the full Lie algebra would provide a simple necessary but not sufficient criteria for universality.

> **Comments:**
> **username_3**: Why we should check only pairs?  
> **username_1**: @AlexV: Because the Lie bracket takes operates on 2 inputs. Every time you produce a new linearly independent operator you produce an orthogonal one and repeat until you get closure.  
> **username_3**: I meant you should consider $[\ldots[H_k,H_j],H_l],\ldots]$, but not only pairs, e.g. see my own paper http://arxiv.org/abs/quant-ph/0010071  
> **username_1**: @AlexV: You don't need to. It's a vector space, so a vector is orthogonal to a given subspace if and only if it is orthogonal to any basis for that subspace.  
> **username_3**: Likely we are talking about different things - which vector space you are talking about? You do not know from very beginning the subalgebra generated by your gates - you need to construct that from given Hamiltonians to check if it whole Lie algebra.  
> **username_3**: There is yet another problem - I think, using example of non-universal set of gates discussed in my paper (and in many other places) we may construct example, then changing a gate on arbitrary small value may convert set to universal.  
> **username_1**: @AlexV: The Lie algebra is a vector space together with a Lie Bracket operator. I'm using the fact that it is a vector space which has a maximum dimension, and hence you can impose a basis on it. If this is closed under the Lie bracket, then taking Lie brackets of Lie brackets will still result in the same space. Only if it is not close will higher order terms play a role. However, if you check, and find that the Lie bracket gives you vectors outside the space, you simply form a new basis using these and the old basis via Gram-Schmidt, and repeat.  
> **username_1**: @AlexV: This is implicitly including the higher order terms, whenever the Lie bracket gives you a vector linearly independent of the previous ones. I simply chose to write it as a recursive process considering only pairs each time, since this makes it obvious that the process must terminate in finite time, due to the finite dimension of the space (and hence finite number of recursions). This is akin to saying that we do one round in which we consider higher order terms, but only up to the $d^2$ terms deep (where $d$ is the dimension of the Hilbert space).  
> **username_3**: O'K. But you should agree, that such process has exponential complexity with respect to number of qubits (and gates, if the numbers are proportional one). Now if we have some exotic set of gates and need to know if it is universal for any number of qubits, why such a problem should necessary be decidable?  
> **username_1**: @AlexV: Yes, absolutely it does have exponential time complexity in the number of qubits (but polynomial in the dimensionality of the space), but the point is that there is an exponential time algorithm for the Hamiltonian version of the problem. For gates, I'm not sure that this is still true, but I suspect it is. I think that you can probably approximate Hamiltonians via Solovay-Kitaev or decide that the group is finite in some bounded time, but this is conjecture. However, taking the log of the gates gives you a necessary but not sufficient criteria for universality.  
> **username_1**: @AlexV: I should point out, however, that there is often a polynomial time algorithm. Daniel Burgarth and Alastair Kay have both done a fair amount of work on this problem for restricted types of Hamiltonians.  
> **username_3**: I did not see a work of Daniel Burgarth and Alastair Kay on the particular theme, but in works of other authors most often appear the same $spin(n)$ theme, but it is necessary some time, to check the isomorphism. Anyway, in many classical problems we should consider $n \to \infty$ to lost decidability.  

---

