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

Add exactn cpp binding #1014

Merged
merged 95 commits into from
Dec 11, 2024
Merged

Add exactn cpp binding #1014

merged 95 commits into from
Dec 11, 2024

Conversation

LuisAlfredoNu
Copy link
Contributor

@LuisAlfredoNu LuisAlfredoNu commented Nov 28, 2024

Context:
Adding the backend Exact Tensor Network from lightning.tensor to the Python layer

Description of the Change:

  • Add pybind layer for the ExaTNCuda class
  • Update the python layer unit tests.
  • Python layer refactoring to allow runtime selection of MPS and ExaTN
  • Python layer unit tests update (gates, analytical measurement)

Benefits:

  1. Refactor MPSTNCuda class to TNCuda class

    • Both MPS and Exact TensorNetwork backends will be handled by the TNCuda class
    • User can select either MPS or Exact TensorNetwork at runtime by passing str (mps or exatn) to the constructor of theTNCuda class.
  2. Measurement class

    • expval() support can be get without changing current code base for the MPS backend.

Possible Drawbacks:

  • qml.StatePrep() won't be supported for 'exatn'

Related GitHub Issues:

[sc-77837][sc-77840]

multiphaseCFD and others added 30 commits November 4, 2024 14:23
### Before submitting

Please complete the following checklist when submitting a PR:

- [ ] All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to
the
      [`tests`](../tests) directory!

- [ ] All new functions and code must be clearly commented and
documented.
If you do make documentation changes, make sure that the docs build and
      render correctly by running `make docs`.

- [ ] Ensure that the test suite passes, by running `make test`.

- [ ] Add a new entry to the `.github/CHANGELOG.md` file, summarizing
the
      change, and including a link back to the PR.

- [ ] Ensure that code is properly formatted by running `make format`. 

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


------------------------------------------------------------------------------------------------------------

**Context:**
Lightning.tensor device adding TN backend

**Description of the Change:**
* Unit tests for gate support
* Unit tests for measurements

**Benefits:**

**Possible Drawbacks:**

**Related GitHub Issues:**

[sc-77835]

---------

Co-authored-by: Shuli Shu <[email protected]>
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Thanks @LuisAlfredoNu for updating the design and naming conventions! Here are my suggestions for the implementation and docstrings. I'd be happy to review the PR again after addressing the unresolved comments

pennylane_lightning/core/_serialize.py Outdated Show resolved Hide resolved
pennylane_lightning/core/_serialize.py Outdated Show resolved Hide resolved
pennylane_lightning/core/_serialize.py Outdated Show resolved Hide resolved
pennylane_lightning/core/_serialize.py Show resolved Hide resolved
pennylane_lightning/core/_serialize.py Show resolved Hide resolved
pennylane_lightning/lightning_tensor/_tensornet.py Outdated Show resolved Hide resolved
josephleekl
josephleekl previously approved these changes Dec 6, 2024
Copy link
Contributor

@josephleekl josephleekl left a comment

Choose a reason for hiding this comment

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

Thanks for the great work @LuisAlfredoNu, I've just added some minor comments!

@josephleekl josephleekl dismissed their stale review December 6, 2024 23:07

LT test needs to pass first

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

Nice work @LuisAlfredoNu!
I have nothing more to add, except for a few questions.

@multiphaseCFD
Copy link
Member

I will update UI stuff later in a following PR defined in [sc-80075]. CC @maliasadi

Copy link
Member

@multiphaseCFD multiphaseCFD left a comment

Choose a reason for hiding this comment

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

Thanks @LuisAlfredoNu for the nice work! Happy to approve.

@multiphaseCFD multiphaseCFD merged commit 182b9cd into master Dec 11, 2024
112 of 115 checks passed
@multiphaseCFD multiphaseCFD deleted the add_exatn_cpp_binding branch December 11, 2024 17:04
@LuisAlfredoNu LuisAlfredoNu mentioned this pull request Jan 14, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building. ci:use-gpu-runner Enable usage of GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants