-
Notifications
You must be signed in to change notification settings - Fork 187
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
[Demo] The KAK theorem #1227
Open
dwierichs
wants to merge
37
commits into
master
Choose a base branch
from
kak-theorem
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Demo] The KAK theorem #1227
Changes from 4 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
15c4690
add dummy files
dwierichs 5372259
some text and structure ideas
dwierichs 59000ea
Merge branch 'master' into kak-theorem
dwierichs 7b21c93
outline
dwierichs 8fee71b
draft
dwierichs 497a8ef
polish
dwierichs edf6fa4
mooooore
dwierichs ea8eebb
almost finalize draft
dwierichs c2485e4
polish
dwierichs 8f9100a
Merge branch 'master' into kak-theorem
dwierichs 366837e
punctuation
dwierichs 9812f37
Apply suggestions from code review
dwierichs 951b6b1
code review
dwierichs ea28b4b
Merge branch 'kak-theorem' of github.com:PennyLaneAI/qml into kak-the…
dwierichs 6ba0f44
Merge branch 'master' into kak-theorem
dwierichs c218fe1
code review cont
dwierichs 02b9bc7
more review
dwierichs 94d23a1
references
dwierichs ef2b9ac
whitespace
dwierichs 699a35f
polish
dwierichs f5ca7ef
polish
dwierichs c0a6a82
quotes
dwierichs 09629fd
remove empty doi
dwierichs 62fc819
code review; undo accidental minuscilization
dwierichs 533f0ce
black
dwierichs d3f82f8
spoiler: factorization
dwierichs 11958ef
Merge branch 'master' into kak-theorem
dwierichs c9da2f6
typo
dwierichs 60ba852
Merge branch 'master' into kak-theorem
dwierichs 7ce490d
Apply suggestions from code review
dwierichs 6d19c38
Update demonstrations/tutorial_kak_theorem.metadata.json
dwierichs daeb3ec
accidental deletion
dwierichs 20f4cdb
review
dwierichs 17ae2e2
Merge branch 'master' into kak-theorem
dwierichs 6ec9b4d
formatting
dwierichs 9c7578f
revert multi-mathfrak
dwierichs 2b91e03
review
dwierichs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+37.9 KB
_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_kak_theorem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.5 KB
_static/demo_thumbnails/opengraph_demo_thumbnails/OGthumbnail_kak_theorem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.8 KB
_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_kak_theorem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"title": "The KAK theorem", | ||
"authors": [ | ||
{ | ||
"username": "dwierichs" | ||
} | ||
], | ||
"dateOfPublication": "2024-12-05T00:00:00+00:00", | ||
"dateOfLastModification": "2024-12-05T00:00:00+00:00", | ||
"categories": [ | ||
"Quantum Computing", | ||
"Algorithms" | ||
], | ||
"tags": [], | ||
"previewImages": [ | ||
{ | ||
"type": "thumbnail", | ||
"uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_kak_theorem.png" | ||
}, | ||
{ | ||
"type": "large_thumbnail", | ||
"uri": "/_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_kak_theorem.png" | ||
} | ||
], | ||
Comment on lines
+15
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tk |
||
"seoDescription": "Learn about the KAK theorem and how it powers circuit decompositions.", | ||
"doi": "", | ||
"canonicalURL": "/qml/demos/tutorial_kak_theorem", | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"references": [ | ||
], | ||
"basedOnPapers": [], | ||
"referencedByPapers": [], | ||
"relatedContent": [ | ||
{ | ||
"type": "demonstration", | ||
"id": "tutorial_liealgebra", | ||
"weight": 1.0 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
r"""The KAK theorem | ||
=================== | ||
|
||
The KAK theorem is a beautiful mathematical result from Lie theory, with | ||
particular relevance for quantum computing research. It can be seen as a | ||
generalization of the singular value decomposition, and therefore falls | ||
under the large umbrella of matrix factorizations. This allows us to | ||
use it for quantum circuit decompositions. However, it can also | ||
be understood from a more abstract point of view, as we will see. | ||
|
||
In this demo, we will discuss so-called symmetric spaces, which arise from | ||
subgroups of Lie groups. For this, we will focus on the algebraic level | ||
and introduce Cartan involutions/decompositions, horizontal | ||
and vertical subspaces, as well as horizontal Cartan subalgebras. | ||
With these tools in our hands, we will then learn about the KAK theorem | ||
itself. | ||
We conclude with a famous application of the theorem to circuit decomposition | ||
by Khaneja and Glaser [#khaneja_glaser]_, which provides a circuit | ||
template for arbitrary unitaries on any number of qubits, and proved for | ||
the first time that single and two-qubit gates are sufficient to implement them. | ||
|
||
While this demo is of more mathematical nature than others, we will include | ||
hands-on examples throughout. | ||
|
||
.. figure:: ../_static/demo_thumbnails/opengraph_demo_thumbnails/OGthumbnail_kak_theorem.png | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tk to replace with the actual image |
||
:align: center | ||
:width: 60% | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:target: javascript:void(0) | ||
|
||
.. note:: | ||
|
||
In the following we will assume a basic understanding of vector spaces, | ||
linear maps, and Lie algebras. For the former two, we recommend a look | ||
at your favourite linear algebra material, for the latter see our | ||
:doc:`introduction to (dynamical) Lie algebras </demos/tutorial_liealgebra/>`. | ||
|
||
|
||
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. | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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) | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- [optional] CNOT count | ||
|
||
|
||
Conclusion | ||
---------- | ||
dwierichs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
In this demo we learned about the KAK theorem and how it uses a Cartan | ||
decomposition of a Lie algebra to decompose its Lie group. | ||
A famous immediate application of this result is the circuit decomposition, or | ||
parametrization, for arbitrary qubit numbers by Khaneja and Glaser. It also allowed | ||
us to prove universality of single and two-qubit unitaries for quantum computation. | ||
|
||
If you are interested in other applications of Lie theory in the field of | ||
quantum computing, you are in luck! It has been a handy tool throughout the last | ||
decades, e.g., for the simulation and compression of quantum circuits, # TODO: REFS | ||
in quantum optimal control, and for trainability analyses. For Lie algebraic | ||
classical simulation of quantum circuits, check the | ||
:doc:`g-sim </demos/tutorial_liesim/>` and | ||
:doc:`(g+P)-sim </demos/tutorial_liesim_extension/>` demos, and stay posted for | ||
a brand new demo on compiling Hamiltonian simulation circuits with the KAK theorem! | ||
|
||
|
||
The props | ||
--------- | ||
|
||
Adjoint representation | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
""" | ||
|
||
import pennylane as qml | ||
|
||
###################################################################### | ||
# | ||
# References | ||
# ---------- | ||
# | ||
# .. [#khaneja_glaser] | ||
# | ||
# Navin Khaneja, Steffen Glaser | ||
# "Cartan decomposition of SU(2^n), constructive controllability of spin systems and universal quantum computing" | ||
# `arXiv:quant-ph/0010100 <https://arxiv.org/abs/quant-ph/0010100>`__, 2000 | ||
# | ||
# About the author | ||
# ---------------- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
tk