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

Implementing Exact Tensor Network method for default.tensor #5786

Merged
merged 48 commits into from
Jun 13, 2024

Conversation

PietropaoloFrisoni
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni commented Jun 3, 2024

Context: Currently, the new default.tensor device can only simulate quantum circuits using the Matrix Product State (MPS) method, based on quimb's CircuitMPS class.

Description of the Change: With this PR, the device also supports the Exact Tensor Network method based on quimb's Circuit class. This completes the implementation of the method keyword argument, which can be set to either mps or tn. For this quarter, this is expected to be the last feature for the default.tensor device (except for refinements, bug fixes, and performance improvements).

Benefits: A new simulation method is implemented for this device, enabling new functionalities for users.

Possible Drawbacks: This PR just implements an additional method, but it does not modify the existing functionalities (except for some minor improvements and clarifications in the documentation).

Related GitHub Issues: None.

Related Shortcut Stories:
[sc-60805]
[sc-64011]
[sc-64284]

@PietropaoloFrisoni PietropaoloFrisoni changed the title E.C. [ci skip] Implementing tns method to default.tensor Jun 3, 2024
@PietropaoloFrisoni PietropaoloFrisoni changed the title Implementing tns method to default.tensor Implementing tns method for default.tensor Jun 3, 2024
@PietropaoloFrisoni PietropaoloFrisoni changed the title Implementing tns method for default.tensor Implementing Exact Tensor Network method for default.tensor Jun 3, 2024
@PietropaoloFrisoni
Copy link
Contributor Author

Thanks @vincentmr, I am in total favor of adding rehearsals for the TN method in another PR. This argument can be passed indeed to the local_expectation function

@PietropaoloFrisoni
Copy link
Contributor Author

Thank you @Qottmann.

How would you feel about making two separate toggle sections "MPS method" and "TN method"? I think it would make sense to separate the two.

I agree. I tried to separate the two in the Usage details section (for example with subtitles), but actually, Sphyinx is giving me some problems (probably because everything is in an expandable section, but I am not sure).

I am also thinking if some simple pictorial illustrations could significantly ease communicating the difference between the two methods. Not sure this has to be in this PR, a general idea to put out there. I would be happy to help with this.

Good point, I think that would be very helpful, but probably in a separate tutorial or a slightly different context. Here I think we already provided a lot of information compared to the docs of other devices

Copy link
Contributor

@vincentmr vincentmr 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 landing all TN features @PietropaoloFrisoni . I think this is ready to merge. I'm leaving suggestions but nothing blocking on my side.

pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
pennylane/devices/default_tensor.py Outdated Show resolved Hide resolved
tests/devices/default_tensor/test_default_tensor.py Outdated Show resolved Hide resolved
@PietropaoloFrisoni
Copy link
Contributor Author

@vincentmr Thanks, excellent suggestions!

Copy link
Contributor

@Qottmann Qottmann left a comment

Choose a reason for hiding this comment

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

Looks good to me, great work @PietropaoloFrisoni !

The docs could still be a bit more beginner friendly for a lay person but that should not block this PR 👍

@PietropaoloFrisoni PietropaoloFrisoni enabled auto-merge (squash) June 13, 2024 02:12
@PietropaoloFrisoni PietropaoloFrisoni merged commit 2252d45 into master Jun 13, 2024
40 checks passed
@PietropaoloFrisoni PietropaoloFrisoni deleted the tn_method_default_tensor branch June 13, 2024 02:38
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.

None yet

4 participants