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

update(cirq-rigetti): use pyquil v4 #6281

Open
wants to merge 94 commits into
base: main
Choose a base branch
from

Conversation

jselig-rigetti
Copy link

Refactors as necessary to anticipate the release of PyQuil v4. Changes between the RC used here and the eventual full release should be compatible, but leave this MR as a draft until the dependency can be pinned to a full >=4.0.0 release.

@google-cla
Copy link

google-cla bot commented Sep 6, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@CirqBot CirqBot added the size: M 50< lines changed <250 label Sep 6, 2023
@jselig-rigetti jselig-rigetti force-pushed the rigetti-use-pyquil-v4 branch 2 times, most recently from d8c1e61 to 1787c12 Compare September 6, 2023 22:12
raise ValueError(f'Symbols not valid for region name {region_name}')
qam_execution_result = quantum_computer.qam.run(executable)
qam_execution_result = quantum_computer.qam.run(executable, memory_map)

Choose a reason for hiding this comment

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

We need to check for atomic values and wrap them in a list to prevent a breaking change here.

In v3, Program.write_memory accepted atomic values for memory regions of length 1. For example, Program.write_memory("ro", 1) was valid if ro was defined as DECLARE ro BIT[1]. In v4, the new MemoryMap only accepts sequences of values for a memory region, even if that memory region happens to be length 1.

Copy link
Author

Choose a reason for hiding this comment

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

fixed this in the lines above 👍

@vtomole
Copy link
Collaborator

vtomole commented Sep 18, 2023

Hey @jselig-rigetti @MarquessV

Can either of you please review rigetti/qcs-api-client-python#12? It's been causing incompatibility issues with Cirq.

@jselig-rigetti jselig-rigetti marked this pull request as ready for review September 20, 2023 15:14
@jselig-rigetti jselig-rigetti force-pushed the rigetti-use-pyquil-v4 branch 2 times, most recently from 86fa3dc to c5f7f3a Compare October 19, 2023 15:07
@vtomole
Copy link
Collaborator

vtomole commented Nov 16, 2023

@jselig-rigetti @MarquessV Hey, how's this PR going?

@MarquessV
Copy link

Hey @vtomole! This PR is ready to review from our perspective. Anything else you need us to do?

prag16 and others added 9 commits May 28, 2024 11:53
* Create generalized_uniform_superposition_gate.py

 Creates a generalized uniform superposition state, $\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1}  \ket{j} $ (where 1< M <= 2^n), 
    using n qubits, according to the Shukla-Vedula algorithm [SV24].

    Note: The Shukla-Vedula algorithm [SV24] offers an efficient approach for creation of a generalized uniform superposition 
    state of the form, $\frac{1}{\sqrt{M}} \sum_{j=0}^{M-1}  \ket{j} $, requiring only $O(log_2 (M))$ qubits and $O(log_2 (M))$ 
    gates. This provides an exponential improvement (in the context of reduced resources and complexity) over other approaches in the literature.

Reference:
[SV24] A. Shukla and P. Vedula, “An efficient quantum algorithm for preparation of uniform quantum superposition states,” 
 Quantum Information Processing, 23(38): pp. 1-32 (2024).
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Noureldin <noureldinyosri@google.com>
* add internal gate to device proto

* build protos

* tests pass

* add docstring

* build protos

* build protos
- Fix syntax error in `docs/noise/_index.yaml`
- Stop including deleted yaml file
- Format with the yaml_format Google tool

Fixes quantumlib#6587
- Update the stale list of pre-release notebooks by
  dropping notebooks that work with the last release 1.3.0
- Enable notebook tests that pass at Cirq HEAD
- Fix old instructions on installing pre-release cirq
- Add missing import to examples/stabilizer_code.ipynb

Ref: https://github.com/quantumlib/Cirq/blob/main/docs/dev/notebooks.md
- Avoid passing an empty string argument to `check/format-incremental`
  when invoked from `check/all`

- Improve validation of the git-revision argument in check scripts by
  allowing git tags that resolve to a commit

- Fix invalid use of `?` in egrep pattern

- Make check/mypy pass in the dev.env.txt virtual environment
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@pavoljuhas
Copy link
Collaborator

@jselig-rigetti - FYI, I just merged the main branch into jselig-rigetti:rigetti-use-pyquil-v4.

It makes it easier to review this PR, otherwise GitHub would think the changes started at the original fork point and would list over 300 changed files to review.

pavoljuhas added a commit that referenced this pull request May 29, 2024
- allow latest scipy because quimb>=1.18 works with scipy-1.13
  (context in #6543)
- allow latest rstcheck
- fix dependency specification for tensorflow-docs so it works with
  `uv pip compile`
- Enable the current latest versions of notebook, ipykernel, papermill
  which are only used for notebook tests
- Add temporary specifications for notebook-related transitive dependencies
  to help pip dependency resolver (should be redundant after #6281) 

Partially fixes #6464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet