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

[labs.dla 5] All Cartan involutions + Cartan subalgebra #6396

Merged
merged 468 commits into from
Dec 11, 2024
Merged

Conversation

Qottmann
Copy link
Contributor

@Qottmann Qottmann commented Oct 15, 2024

Providing dense implementations for all Cartan involutions listed in appendix C of https://arxiv.org/abs/2406.04418

Adds

  • recursive_cartan_decomp function for recursive cartan decompositions with the appropriate basis changes in between
  • All canonical Cartan involutions working both with dense and operator representations
  • cartan_subalgebra function to compute the Cartan subalgebra (CSA), i.e. the maximal Abelian subalgebra of $\mathfrak{m}$ using the adjoint representation
  • misc. helper functions

Iterative Cartan decomposition:

from pennylane.labs.dla import AI, AII, AIII, BDI, CI, CII, DIII, cartan_decomposition, check_cartan_decomp

g = list(qml.pauli.pauli_group(3)) # su(8)
g = [qml.matrix(_, wire_order=range(3)) for _ in g]
k0, m0 = cartan_decomposition(g, AII)
print(f"First iteration: {len(k0)}, {len(m0)}")
assert check_cartan_decomp(k0, m0)

k1, m1 = cartan_decomposition(k0, CI)
assert check_cartan_decomp(k1, m1)
print(f"Second iteration: {len(k1)}, {len(m1)}")
First iteration: 36, 28
Second iteration: 16, 20

[sc-76116]

@Qottmann Qottmann changed the base branch from master to cartan October 15, 2024 10:13
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@Qottmann Qottmann changed the title [labs] [WIP] (Almost) All Cartan involutions [labs.dla 5] [WIP] (Almost) All Cartan involutions Nov 11, 2024
Qottmann and others added 27 commits November 11, 2024 18:52
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan.py Show resolved Hide resolved
pennylane/labs/dla/cartan.py Outdated Show resolved Hide resolved
pennylane/labs/dla/involutions.py Outdated Show resolved Hide resolved
@Qottmann
Copy link
Contributor Author

Qottmann commented Dec 9, 2024

@dwierichs feel free to push suggestions straight away 👍

dwierichs and others added 6 commits December 9, 2024 11:43
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Nice! My outputs for the cartan_subalgebra section look a little different (some plus and minus signs). If you could double-check that would be great

pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Show resolved Hide resolved
pennylane/labs/dla/cartan_subalgebra.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Happy to see this conclude! 💯
Amazing job pulling this one through!

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

🥇

@Qottmann Qottmann enabled auto-merge (squash) December 11, 2024 15:12
@Qottmann Qottmann merged commit 3935d43 into master Dec 11, 2024
46 checks passed
@Qottmann Qottmann deleted the involutions branch December 11, 2024 15:28
mudit2812 pushed a commit that referenced this pull request Dec 13, 2024
Providing dense implementations for all Cartan involutions listed in
appendix C of https://arxiv.org/abs/2406.04418

Adds
* `recursive_cartan_decomp` function for recursive cartan decompositions
with the appropriate basis changes in between
* All canonical Cartan involutions working both with dense and operator
representations
* `cartan_subalgebra` function to compute the Cartan subalgebra (CSA),
i.e. the maximal Abelian subalgebra of $\mathfrak{m}$ using the adjoint
representation
 * misc. helper functions

Iterative Cartan decomposition:

```python
from pennylane.labs.dla import AI, AII, AIII, BDI, CI, CII, DIII, cartan_decomposition, check_cartan_decomp

g = list(qml.pauli.pauli_group(3)) # su(8)
g = [qml.matrix(_, wire_order=range(3)) for _ in g]
k0, m0 = cartan_decomposition(g, AII)
print(f"First iteration: {len(k0)}, {len(m0)}")
assert check_cartan_decomp(k0, m0)

k1, m1 = cartan_decomposition(k0, CI)
assert check_cartan_decomp(k1, m1)
print(f"Second iteration: {len(k1)}, {len(m1)}")
```

```pycon
First iteration: 36, 28
Second iteration: 16, 20
```

[sc-76116]

---------

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Pietropaolo Frisoni <pietropaolo.frisoni@xanadu.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants