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

[DLA 3] Add qml.dla.adjoint_repr function #5406

Merged
merged 315 commits into from
Apr 23, 2024
Merged

[DLA 3] Add qml.dla.adjoint_repr function #5406

merged 315 commits into from
Apr 23, 2024

Conversation

Qottmann
Copy link
Contributor

@Qottmann Qottmann commented Mar 19, 2024

A function to compute the adjoint representation of a DLA

  • Basic functionality
  • Basic testing
  • Docs
  • changelog

[sc-51422]
#5161 (DLA1) #5169 (DLA2) #5406 (DLA3)

Qottmann and others added 30 commits February 13, 2024 14:39
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @Qottmann! This is great 🚀

@trbromley trbromley added this to the v0.36 milestone Apr 19, 2024
Qottmann added a commit that referenced this pull request Apr 22, 2024
…ndent vectors (#5161)

This class enables easy implementation for `qml.dla.lie_closure`
realized in the follow-up PR.
The class VSpace is currently not (yet) user-facing and acts as a
utility to lie_closure. We could consider making it user-facing though.
Open to discussing this! The main reason I am holding back is that the
UI is experimental and some things may be subject to change /
improvement, so I dont want to lock in just yet.

The main point of this class is to efficiently keep track of linearly
independent operators that span a vector space, specifically for
PauliSentences.

This is done by storing and processing ``M``, which
is a dictionary-of-keys (DOK) style sparse representation of the set of
basis vectors. You can
think of it as the numpy-equivalent of a PauliSentence: each
``PauliWord`` (key of ``PauliSentence``)
represents one row of ``M`` with the coefficient (value of
``PauliSentence``).
For example the set of 3 linearly independent generators ``X(0) + X(1),
X(0) + X(2), X(0) + 0.5 * Y(0)``
can be represented as

```
[
    [1, 1, 1],
    [1, 0, 0],
    [0, 1, 0],
    [0, 0, 0.5]
]
```

where each column represents one sentence, and each row represents the
coefficient of the respective word in the sentence.
To make sense of this representation one additionally needs to keep
track of the mapping between keys and rows. In this case we have

```
pw_to_idx = {
    X(0) : 0,
    X(1) : 1,
    X(2) : 2,
    Y(0) : 3
}
``` 

where we have set the numbering based on appearance in the list of
generators. This mapping is in general not unique.

ToDo

- [x] VSpace class init
- [x] VSpace.add() method
- [x] test init
- [x] test VSpace.add()
- [x] add cheaper check for proportionality before performing rank
computation
- [x] add test for util accordingly
- [x] increase test coverage (i.e. add examples)
- [x] check edge cases
- [x] changelog (no changelog since this is private functionality)
- [x] Fix equality check
- [x] Overhaul `VSpace.add` logic (inplace vs not)

Based off @dwierichs 's
[prototype](#4852)
Follow-up PR adding lie_closure
#5169
[sc-51430]

#5161 (DLA1)
#5169 (DLA2)
#5406 (DLA3)

---------

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Base automatically changed from lieclosure2 to master April 22, 2024 17:02
Qottmann added a commit that referenced this pull request Apr 22, 2024
[WIP]

- [x] Basic functionality
- [x] Basic tests
- [x] compatibility with PauliWord + tests
- [x] compatibility with Operators + tests
- [x] Figure out normalization standard
- [x] changelog


Follow-up on #5161

**Shortcut Stories:**
[sc-51421]

#5161 (DLA1)
#5169 (DLA2)
#5406 (DLA3)

---------

Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
@Qottmann Qottmann enabled auto-merge (squash) April 23, 2024 07:37
@Qottmann Qottmann merged commit a8bba50 into master Apr 23, 2024
38 checks passed
@Qottmann Qottmann deleted the adjointrepr branch April 23, 2024 08:11
Qottmann added a commit that referenced this pull request Apr 25, 2024
A simple `qml.dla.center` function

#5161 (DLA1)
#5169 (DLA2)
#5406 (DLA3)
#5477 (DLA4)

Implement center [sc-51435]

---------

Co-authored-by: Vincent Michaud-Rioux <vincentm@nanoacademic.com>
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
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.

4 participants