Skip to content
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
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
15c4690
add dummy files
dwierichs Oct 3, 2024
5372259
some text and structure ideas
dwierichs Oct 3, 2024
59000ea
Merge branch 'master' into kak-theorem
dwierichs Oct 14, 2024
7b21c93
outline
dwierichs Oct 14, 2024
8fee71b
draft
dwierichs Oct 17, 2024
497a8ef
polish
dwierichs Oct 17, 2024
edf6fa4
mooooore
dwierichs Oct 18, 2024
ea8eebb
almost finalize draft
dwierichs Oct 18, 2024
c2485e4
polish
dwierichs Oct 23, 2024
8f9100a
Merge branch 'master' into kak-theorem
dwierichs Oct 23, 2024
366837e
punctuation
dwierichs Oct 23, 2024
9812f37
Apply suggestions from code review
dwierichs Oct 28, 2024
951b6b1
code review
dwierichs Oct 29, 2024
ea28b4b
Merge branch 'kak-theorem' of github.com:PennyLaneAI/qml into kak-the…
dwierichs Oct 29, 2024
6ba0f44
Merge branch 'master' into kak-theorem
dwierichs Oct 29, 2024
c218fe1
code review cont
dwierichs Nov 4, 2024
02b9bc7
more review
dwierichs Nov 4, 2024
94d23a1
references
dwierichs Nov 4, 2024
ef2b9ac
whitespace
dwierichs Nov 4, 2024
699a35f
polish
dwierichs Nov 5, 2024
f5ca7ef
polish
dwierichs Nov 6, 2024
c0a6a82
quotes
dwierichs Nov 6, 2024
09629fd
remove empty doi
dwierichs Nov 6, 2024
62fc819
code review; undo accidental minuscilization
dwierichs Nov 11, 2024
533f0ce
black
dwierichs Nov 11, 2024
d3f82f8
spoiler: factorization
dwierichs Nov 13, 2024
11958ef
Merge branch 'master' into kak-theorem
dwierichs Nov 13, 2024
c9da2f6
typo
dwierichs Nov 18, 2024
60ba852
Merge branch 'master' into kak-theorem
dwierichs Nov 18, 2024
7ce490d
Apply suggestions from code review
dwierichs Nov 20, 2024
6d19c38
Update demonstrations/tutorial_kak_theorem.metadata.json
dwierichs Nov 20, 2024
daeb3ec
accidental deletion
dwierichs Nov 20, 2024
20f4cdb
review
dwierichs Nov 20, 2024
17ae2e2
Merge branch 'master' into kak-theorem
dwierichs Nov 20, 2024
6ec9b4d
formatting
dwierichs Nov 21, 2024
9c7578f
revert multi-mathfrak
dwierichs Nov 21, 2024
2b91e03
review
dwierichs Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions demonstrations/tutorial_kak_theorem.metadata.json
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",
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tk

"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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
}
]
}
175 changes: 175 additions & 0 deletions demonstrations/tutorial_kak_theorem.py
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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
# ----------------
Loading