Skip to content

Qiskit1.0#475

Merged
caleb-johnson merged 41 commits into
mainfrom
qiskit1.0
Feb 12, 2024
Merged

Qiskit1.0#475
caleb-johnson merged 41 commits into
mainfrom
qiskit1.0

Conversation

@caleb-johnson
Copy link
Copy Markdown
Collaborator

@caleb-johnson caleb-johnson commented Feb 7, 2024

Fixes #474

This PR upgrades the code base to be compatible with Qiskit 1.0

@caleb-johnson caleb-johnson marked this pull request as ready for review February 7, 2024 17:53
Comment thread pyproject.toml Outdated
@coveralls
Copy link
Copy Markdown

coveralls commented Feb 7, 2024

Pull Request Test Coverage Report for Build 7875313054

Details

  • 0 of 4 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 93.541%

Totals Coverage Status
Change from base Build 7875286910: 0.005%
Covered Lines: 2346
Relevant Lines: 2508

💛 - Coveralls

Comment thread .ruff.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
Comment thread tox.ini Outdated
Comment thread circuit_knitting/cutting/cutting_experiments.py
@caleb-johnson
Copy link
Copy Markdown
Collaborator Author

@garrison , they have removed do_while from the PassManager.append method. Could you point me in the right direction of how we might recreate this functionality in the one spot it is used in our code base + the test?

@caleb-johnson
Copy link
Copy Markdown
Collaborator Author

caleb-johnson commented Feb 8, 2024

@garrison , they have removed do_while from the PassManager.append method. Could you point me in the right direction of how we might recreate this functionality in the one spot it is used in our code base + the test?

From qiskit docs:

Creating flow controllers with flow_controller_conditions keyword arguments was deprecated. Instead, you must explicitly instantiate a controller and set the controller to passes argument.

@garrison
Copy link
Copy Markdown
Member

garrison commented Feb 8, 2024

@garrison , they have removed do_while from the PassManager.append method. Could you point me in the right direction of how we might recreate this functionality in the one spot it is used in our code base + the test?

There are a bunch of instances of this migration at https://github.com/Qiskit/qiskit/pull/11448/files (scroll down to the very last change in that diff, for instance).

Copy link
Copy Markdown
Member

@mrossinek mrossinek left a comment

Choose a reason for hiding this comment

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

Just a minor thing but other than that these changes look good to me 👍

job = PrimitiveJob(self._call, circuits, parameter_values, **run_options)
job.submit()
# The public submit method was removed in Qiskit 1.0
(job.submit if hasattr(job, "submit") else job._submit)()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems a bit odd using a private method here. Then again, you do not really have an alternative with the PrimitiveJob interface.

Why exactly is this ExactSampler needed? I would assume that this works the same as Sampler(..., options={"shots": None}), does it not?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We needed to make ExactSampler because the reference implementation doesn't handle mid-circuit measurements, which is crucial for us.

Ya, this (job.submit if ...)() seemed to be the go-to solution for a couple of other repos as well. The public method didn't carry over from 0.46 to 1.0.

@caleb-johnson caleb-johnson merged commit 0197ac8 into main Feb 12, 2024
@caleb-johnson caleb-johnson deleted the qiskit1.0 branch February 12, 2024 17:21
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.

Support Qiskit 1.0

5 participants