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

generate_cutting_experiments returns coefficients, not weights #412

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

garrison
Copy link
Member

@garrison garrison commented Sep 11, 2023

I noticed that generate_cutting_experiments really returns coefficients, not weights. While weights (e.g., as returned by generate_qpd_weights) are all positive and can be rescaled arbitrarily, coefficients can be either positive or negative and cannot be rescaled arbitrarily. (Actually, the difference between weights and coefficients deserves some explanation, see #411.)

The misleading jump from "coefficients" to weights is in the following snippet:

https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/f33317fde7de9f2c6a5c8916ff301a5388e3eedb/circuit_knitting/cutting/cutting_experiments.py#L144-L145

Interestingly, this was already labeled coefficients at the call site in cutting_experiments.py.

https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/blob/f33317fde7de9f2c6a5c8916ff301a5388e3eedb/circuit_knitting/cutting/cutting_experiments.py#L144-L145

@garrison garrison added the cutting QPD-based circuit cutting code label Sep 11, 2023
@garrison garrison added this to the 0.4.0 milestone Sep 11, 2023
@garrison garrison marked this pull request as ready for review September 11, 2023 01:41
@caleb-johnson
Copy link
Collaborator

caleb-johnson commented Sep 11, 2023

Thanks, as I was rewriting some of this, I noticed that the coefficients returned from decompose are the actual scalars used during reconstruction (they're not manipulated again before scaling the sub-expvals by them). I have never really made a distinction between a weight and a scalar, but your explanation about being able to arbitrarily scale the values makes sense to me :)

Copy link
Collaborator

@caleb-johnson caleb-johnson left a comment

Choose a reason for hiding this comment

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

Thanks!

@garrison garrison merged commit eadd0d7 into main Sep 11, 2023
9 checks passed
@garrison garrison deleted the generate_cutting_experiments-returns-coefficients branch September 11, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants