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

Use dimension option in XIR program #47

Merged
merged 16 commits into from
Jul 16, 2021
Merged

Use dimension option in XIR program #47

merged 16 commits into from
Jul 16, 2021

Conversation

Mandrenkov
Copy link
Collaborator

@Mandrenkov Mandrenkov commented Jul 14, 2021

Context:
The Jet-XIR interpreter does not currently support CV circuits with a Fock ladder cutoff greater than two. This is a consequence of the fact that the Jet-XIR interpreter always constructs Circuit instances with qudits of dimension two.

Description of the Change:

  • A dimension attribute has been added to the Gate class.
  • A pair of abstract FockGate and QubitGate classes now handle the validation of Gate dimensions.
  • The cutoff parameter is now automatically inserted for CV gates by the Jet-XIR interpreter.
  • The dimension option of an XIR program is now validated and used to construct Circuit instances.

Benefits:

  • The Jet-XIR interpreter can handle CV circuits with a Fock ladder cutoff greater than two.
  • There is no need to explicitly state the cutoff dimension of each CV gate in an XIR script.

Possible Drawbacks:
None.

Related GitHub Issues:
None.

@github-actions
Copy link

github-actions bot commented Jul 14, 2021

Test Report (C++) on Ubuntu

    1 files  ±0      1 suites  ±0   0s ⏱️ ±0s
521 tests ±0  521 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
870 runs  ±0  870 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c75e51a. ± Comparison against base commit c75e51a.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Jul 14, 2021

Test Report (Python) on Ubuntu

    1 files  ±0      1 suites  ±0   10s ⏱️ ±0s
529 tests ±0  529 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c75e51a. ± Comparison against base commit c75e51a.

♻️ This comment has been updated with latest results.

@Mandrenkov Mandrenkov mentioned this pull request Jul 14, 2021
Base automatically changed from amplitude-state-array to main July 14, 2021 20:36
@Mandrenkov Mandrenkov requested a review from thisac July 14, 2021 20:56
@Mandrenkov Mandrenkov marked this pull request as ready for review July 14, 2021 20:56
Copy link

@thisac thisac 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! Much nicer to be able to use a script-level option to set the dimension rather than to have to add it as a gate argument. 🙂

Copy link
Collaborator Author

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

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

Much nicer to be able to use a script-level option to set the dimension rather than to have to add it as a gate argument. 🙂

That's right!

@Mandrenkov Mandrenkov merged commit c75e51a into main Jul 16, 2021
@Mandrenkov Mandrenkov deleted the xir-dimension-option branch July 16, 2021 18:03
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