-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Demo: The KAK theorem #1227
base: master
Are you sure you want to change the base?
Conversation
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
Introduction | ||
------------ | ||
|
||
Basic mathematical objects | ||
-------------------------- | ||
|
||
Introduce the mathematical objects that will play together to yield | ||
the KAK theorem. | ||
|
||
(Semi-)simple Lie algebras | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Introduce the notion of a Lie algebra very briefly, refer to existing demo(s). | ||
- Focus on vector space notion being clear. | ||
- [optional] Briefly say what a simple/semisimple Lie algebra is. | ||
- [optional] In particular mention that the adjoint representation is faithful for semisimple algebras. | ||
|
||
Group and algebra interaction | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Exponential map | ||
- adjoint action of group on algebra | ||
- adjoint action of algebra on algebra -> adjoint representation | ||
- adjoint identity (-> g-sim demo) | ||
|
||
Subalgebras and Cartan pairs | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Introduce the notion of a subalgebra. | ||
- Explain that there can be vector subspaces that are not subalgebras. | ||
- Define Cartan pairs via commutation relations | ||
|
||
Cartan subalgebras | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
- Define Cartan subalgebras of :math:`m`. | ||
- Dimension of Cartan subalgebras | ||
- Transition between Cartan subalgebras via :math:`K` | ||
|
||
Involutions | ||
~~~~~~~~~~~ | ||
|
||
- Explain linear maps on (matrix) algebras (-> homomorphism) | ||
- Define involutions. | ||
- Involutions define Cartan pairs (:math:`k = +1 | m = -1` eigenspaces) | ||
- Cartan pairs define involutions :math:`\theta = \Pi_{\mathfrak{k}} - \Pi_{\mathfrak{m}}` | ||
|
||
KAK theorem | ||
~~~~~~~~~~~ | ||
|
||
- KP decomposition | ||
- KAK decomposition | ||
- [optional] implication: KaK on algebra level | ||
|
||
|
||
Two-qubit KAK decomposition | ||
--------------------------- | ||
|
||
- Algebra/subalgebra :math:`\mathfrak{g} =\mathfrak{su}(4) | \mathfrak{k} =\mathfrak{su}(2) \oplus \mathfrak{su}(2)` | ||
- Involution: EvenOdd | ||
- CSA: :math:`\mathfrak{a} = \langle\{XX, YY, ZZ\}\rangle_{i\mathbb{R}}` | ||
- KAK decomposition :math:`U= (A\otimes B) \exp(i(\eta_x XX+\eta_y YY +\eta_z ZZ)) (C\otimes D)`. | ||
- [optional] Mention Cartan coordinates | ||
|
||
Khaneja-Glaser decomposition | ||
---------------------------- | ||
|
||
- Important first recursive decomposition showing universality of single- and two-qubit operations | ||
- Used for practical decompositions, replaced by other, similar decompositions by now | ||
|
||
A recursive decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Show recursion on qubit count | ||
- display resulting decomposition structure | ||
- Mention that a two-qubit interaction is enough to get the CSA elements | ||
- Universality | ||
|
||
The recursion step in detail | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Two substeps in each recursion step: | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^n) | \mathfrak{k} = \mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1}) | \mathfrak{k} = \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
|
||
Overview of resulting decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Count blocks | ||
- [optional] CNOT count | ||
|
||
|
||
Conclusion | ||
---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Qottmann,
can I ask you for some super-preliminary feedback on this, regarding
- overall structure/logic of the outline
- amount of content (also happy about suggestions of things I missed/I should throw out!)
Thanks! 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a lot of ground to cover with quite involved topics. Do you reckon it is realistic to put this all in a demo? This seems like review paper level thoroughness (which makes me think, should we write a review paper on this stuff for physicists?) I actually wouldnt want to scratch anything because I'd be curious to read all of this myself, I am just wondering if you think it's realistic for you to cover all these things in reasonable time (your own time effort) and in a presentation that is not too long (time effort of a reader)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a very fair question. Taking some of this offline.
For the length I see the following options:
- I try to do the shortest version of the demo that I deem understandable and we see whether that already is a good length/complexity. This will have to skip over quite a few things from above.
- We split content up into multiple bits.
- We cover all the content but go very superficial. Not sure that's so nice to have 🤔
- Introduce the notion of a Lie algebra very briefly, refer to existing demo(s). | ||
- Focus on vector space notion being clear. | ||
- [optional] Briefly say what a simple/semisimple Lie algebra is. | ||
- [optional] In particular mention that the adjoint representation is faithful for semisimple algebras. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh good to know! I wasnt aware!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The precise criterion is that the center is trivial, which is a bit more general. But a center would be an Abelian ideal, which semisimple Lie algebras don't have, so semisimple implies faithful ad.rep.
Introduction | ||
------------ | ||
|
||
Basic mathematical objects | ||
-------------------------- | ||
|
||
Introduce the mathematical objects that will play together to yield | ||
the KAK theorem. | ||
|
||
(Semi-)simple Lie algebras | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Introduce the notion of a Lie algebra very briefly, refer to existing demo(s). | ||
- Focus on vector space notion being clear. | ||
- [optional] Briefly say what a simple/semisimple Lie algebra is. | ||
- [optional] In particular mention that the adjoint representation is faithful for semisimple algebras. | ||
|
||
Group and algebra interaction | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Exponential map | ||
- adjoint action of group on algebra | ||
- adjoint action of algebra on algebra -> adjoint representation | ||
- adjoint identity (-> g-sim demo) | ||
|
||
Subalgebras and Cartan pairs | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Introduce the notion of a subalgebra. | ||
- Explain that there can be vector subspaces that are not subalgebras. | ||
- Define Cartan pairs via commutation relations | ||
|
||
Cartan subalgebras | ||
~~~~~~~~~~~~~~~~~~ | ||
|
||
- Define Cartan subalgebras of :math:`m`. | ||
- Dimension of Cartan subalgebras | ||
- Transition between Cartan subalgebras via :math:`K` | ||
|
||
Involutions | ||
~~~~~~~~~~~ | ||
|
||
- Explain linear maps on (matrix) algebras (-> homomorphism) | ||
- Define involutions. | ||
- Involutions define Cartan pairs (:math:`k = +1 | m = -1` eigenspaces) | ||
- Cartan pairs define involutions :math:`\theta = \Pi_{\mathfrak{k}} - \Pi_{\mathfrak{m}}` | ||
|
||
KAK theorem | ||
~~~~~~~~~~~ | ||
|
||
- KP decomposition | ||
- KAK decomposition | ||
- [optional] implication: KaK on algebra level | ||
|
||
|
||
Two-qubit KAK decomposition | ||
--------------------------- | ||
|
||
- Algebra/subalgebra :math:`\mathfrak{g} =\mathfrak{su}(4) | \mathfrak{k} =\mathfrak{su}(2) \oplus \mathfrak{su}(2)` | ||
- Involution: EvenOdd | ||
- CSA: :math:`\mathfrak{a} = \langle\{XX, YY, ZZ\}\rangle_{i\mathbb{R}}` | ||
- KAK decomposition :math:`U= (A\otimes B) \exp(i(\eta_x XX+\eta_y YY +\eta_z ZZ)) (C\otimes D)`. | ||
- [optional] Mention Cartan coordinates | ||
|
||
Khaneja-Glaser decomposition | ||
---------------------------- | ||
|
||
- Important first recursive decomposition showing universality of single- and two-qubit operations | ||
- Used for practical decompositions, replaced by other, similar decompositions by now | ||
|
||
A recursive decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Show recursion on qubit count | ||
- display resulting decomposition structure | ||
- Mention that a two-qubit interaction is enough to get the CSA elements | ||
- Universality | ||
|
||
The recursion step in detail | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Two substeps in each recursion step: | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^n) | \mathfrak{k} = \mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1}) | \mathfrak{k} = \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
|
||
Overview of resulting decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Count blocks | ||
- [optional] CNOT count | ||
|
||
|
||
Conclusion | ||
---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a lot of ground to cover with quite involved topics. Do you reckon it is realistic to put this all in a demo? This seems like review paper level thoroughness (which makes me think, should we write a review paper on this stuff for physicists?) I actually wouldnt want to scratch anything because I'd be curious to read all of this myself, I am just wondering if you think it's realistic for you to cover all these things in reasonable time (your own time effort) and in a presentation that is not too long (time effort of a reader)?
A recursive decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Show recursion on qubit count | ||
- display resulting decomposition structure | ||
- Mention that a two-qubit interaction is enough to get the CSA elements | ||
- Universality | ||
|
||
The recursion step in detail | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Two substeps in each recursion step: | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^n) | \mathfrak{k} = \mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
- Algebra/subalgebra :math:`\mathfrak{g}=\mathfrak{su}(2^{n-1}) \oplus \mathfrak{su}(2^{n-1}) | \mathfrak{k} = \mathfrak{su}(2^{n-1})` | ||
- Involution TBD | ||
- CSA TBD | ||
|
||
Overview of resulting decomposition | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Count blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If things had to be scratched, Perhaps this could be made a separate demo (though I am very interested in the contents here so maybe we can already talk about it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe we could actually have this demo focus on KAK theorem, including only the 2-qubit application.
Then we can have a Khaneja-Glaser decomposition demo as a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah something like that, or even more generally a demo on recursive decomposition, but I think that would depend on our findings this quarter and how much we want to invest (seems like a lot of work to do all of this 😅 )
Group and algebra interaction | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Exponential map | ||
- adjoint action of group on algebra | ||
- adjoint action of algebra on algebra -> adjoint representation | ||
- adjoint identity (-> g-sim demo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how much you plan on talking about these points but could be kept brief
Thank you for opening this pull request. You can find the built site at this link. Deployment Info:
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I absolutely love this and can see this become a super valuable resource for anyone with a physics brackground wanting to dive deeper into the topic (think, in particular, future residents)
In terms of length, it is indeed a chonker but honestly that is fine for this kind of demo. I'd even go as far as saying that it could do with more content, in particular a more non-trivial example beyond su(2). At least for my taste, feel free to go all in.
We should perhaps have someone that is unfamiliar with these concepts also read the demo
.. math:: | ||
|
||
\mathfrak{su}(2) | ||
&= \left\{x \in \mathbb{C}^{(2\times 2)} {\large|} x^\dagger = -x , \text{tr}[x]=0\right\}\\ | ||
&= \left\{\left(\begin{array} i a & b + ic \\ -b + ic & -i a \end{array}\right) | ||
{\large |} a, b, c \in \mathbb{R}\right\}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not start with pauli matrices from the get-go? 😅
There is a simple way to see this; Multiplying a skew-Hermitian matrix | ||
:math:`x\in\mathfrak{su}(n)` by a complex number :math:`c\in\mathbb{C}` will yield | ||
:math:`(cx)^\dagger=\overline{c} x^\dagger=-\overline{c} x,` so that | ||
the result might no longer be in the algebra! If we keep it to real scalars | ||
:math:`c\in\mathbb{R}` only, we have :math:`\overline{c}=c,` so that | ||
:math:`(cx)^\dagger=-cx` and we're fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a simple way to see this; Multiplying a skew-Hermitian matrix | |
:math:`x\in\mathfrak{su}(n)` by a complex number :math:`c\in\mathbb{C}` will yield | |
:math:`(cx)^\dagger=\overline{c} x^\dagger=-\overline{c} x,` so that | |
the result might no longer be in the algebra! If we keep it to real scalars | |
:math:`c\in\mathbb{R}` only, we have :math:`\overline{c}=c,` so that | |
:math:`(cx)^\dagger=-cx` and we're fine. | |
There is a simple way to see this; Multiplying a skew-Hermitian matrix | |
:math:`x\in\mathfrak{su}(n)` by a complex number :math:`c\in\mathbb{C}` will yield | |
:math:`(cx)^\dagger=\overline{c} x^\dagger=-\overline{c} x,` so that | |
the result might no longer be skew-Hermitian, i.e. no longer in the algebra! If we keep it to real scalars | |
:math:`c\in\mathbb{R}` only, we have :math:`\overline{c}=c,` so that | |
:math:`(cx)^\dagger=-cx` and we're fine. |
(personal preference)
all_hermitian = all(qml.equal(qml.adjoint(op).simplify(), op) for op in su2) | ||
print(f"The operators are all Hermitian: {all_hermitian}") | ||
|
||
su2_lie_closed = qml.pauli.dla.lie_closure(su2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
su2_lie_closed = qml.pauli.dla.lie_closure(su2) | |
su2_lie_closed = qml.lie_closure(su2) |
# :doc:`g-sim: Lie algebraic classical simulations </demos/tutorial_liesim/>` for | ||
# further discussion. | ||
# | ||
# .. admonition:: Derivation: Adjoint representations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!
# | ||
# .. math:: | ||
# | ||
# \text{Ad}_{\exp(x)} : \mathfrak{g} \to \mathfrak{g}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the previous definition its mapping
# factorizations in general, and for quantum circuit decompositions in particular. | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to also discuss kak decompositions for specific ops (i.e. writing some_op in g = K_1 a K_2) as well as the version where the op is in m and we can get away with KAK^dagger
p = check_cartan_decomposition(su4, su2_su2, space_name) | ||
|
||
###################################################################### | ||
# .. admonition:: Mathematical detail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super nice!
# | ||
# \mathfrak{a} = \text{span}_{\mathbb{R}}\{iX_0X_1, iY_0Y_1, iZ_0Z_1\} | ||
# | ||
# Clearly, these three operators commute, making :math:`\mathfrak{a}` Abelian. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Clearly, these three operators commute, making :math:`\mathfrak{a}` Abelian. | |
# These three operators commute, making :math:`\mathfrak{a}` Abelian. |
fig, ax = qml.draw_mpl(su4_gate, wire_order=[0, 1])(params) | ||
|
||
###################################################################### | ||
# And that's a wrap on our KAK theorem application for two-qubit gates! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we easily get the optimal 2qubit decomposition from this somehow?
# :math:`y_{1,2}` and :math:`a` for a given gate :math:`U.` If you are | ||
# curious about this question, watch out for follow-up demos! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# :math:`y_{1,2}` and :math:`a` for a given gate :math:`U.` If you are | |
# curious about this question, watch out for follow-up demos! | |
# :math:`y_{1,2}` and :math:`a` for a given gate :math:`U.` |
wouldnt make promises, I'd directly refer to the Kökcü paper or other resources
Title:
The KAK theorem
Summary:
The KAK theorem is a group theoretical tool to decompose operators into a sequence of smaller operators.
It brings an abstract mathematical structure to direct use in compilation and simulation tasks.
In this demo we will explain the mathematical objects "Lie subalgebra", "Cartan involution", and "symmetric space", which are prerequisites to the KAK theorem.
Then we state the theorem and explain how it powers a standard circuit decomposition/template construction technique, which also proves the universality of single- and two-qubit operations for quantum computing.
All steps are illustrated with mathematical and code examples.
Relevant references:
TBD
Possible Drawbacks:
N/A
Related GitHub Issues:
TBD: FDHS demo PR
[sc-74884]
If you are writing a demonstration, please answer these questions to facilitate the marketing process.
"KAK theorem"
"Lie algebra"
"Symmetric space"
"Cartan decomposition" and/or "Cartan involution"
"Khaneja-Glaser decomposition"
"Circuit templates"
"Universality"
(more details here)