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

Quantum gate models for IR integration #16

Merged
merged 78 commits into from
Jun 11, 2021
Merged

Conversation

thisac
Copy link

@thisac thisac commented May 27, 2021

Context:
An abstraction for quantum gates can be useful for building a Jet interpreter for XIR scripts if it supports converting a unitary matrix into a Tensor instance.

Description of the Change:

  • The jet Python package now includes a base Gate class for modelling quantum gates.
  • A number of derived Gate classes for modelling CV and qubit gates are now available.
  • The data type factory methods in __init__.py have been moved to a separate factory.py module.

Benefits:

  • It is trivial to model quantum gates with the jet package and convert them into Tensor objects.

Possible Drawbacks:
None.

Related GitHub Issues:
None.

@Mandrenkov
Copy link
Collaborator

Thanks for the review, @josh146! Let me know what you think of the changes.

@Mandrenkov Mandrenkov requested a review from josh146 June 8, 2021 17:55
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Excellent work here. I think it can be left for now, but at some later date I'd love to see |0><0| and |1><1| projectors, as well as controlled arbitrary (non-)unitary gates. Though, I think what you have here looks great, and I'm happy to see it go in!

python/jet/gates.py Outdated Show resolved Hide resolved
python/jet/gates.py Outdated Show resolved Hide resolved
@antalszava antalszava self-requested a review June 9, 2021 13:50
Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

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

Thanks @Mandrenkov!

Copy link
Contributor

@antalszava antalszava left a comment

Choose a reason for hiding this comment

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

Overall this looks like an amazing addition! 😍 🚀

For improvement (maybe in a subsequent PR even), the docstrings could be adjusted to adhere to convention. Was also curious about each CV gate getting a dedicated cutoff value, not sure if this can be easily kept track of for the entire tensor network (maybe missing something).

python/jet/gate.py Outdated Show resolved Hide resolved
python/jet/gate.py Outdated Show resolved Hide resolved
python/jet/gate.py Outdated Show resolved Hide resolved
python/jet/gate.py Outdated Show resolved Hide resolved
python/jet/gate.py Outdated Show resolved Hide resolved
python/tests/jet/test_gate.py Show resolved Hide resolved
python/jet/gate.py Outdated Show resolved Hide resolved
python/tests/jet/test_gate.py Outdated Show resolved Hide resolved
python/tests/jet/test_gate.py Show resolved Hide resolved
python/jet/factory.py Outdated Show resolved Hide resolved
@Mandrenkov Mandrenkov merged commit 760b11e into main Jun 11, 2021
@Mandrenkov Mandrenkov deleted the xir-interface-gates branch June 11, 2021 15:42
@Mandrenkov Mandrenkov mentioned this pull request Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants