Closed purva-thakre closed 2 days ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.34%. Comparing base (
b58f029
) to head (bfe07bd
). Report is 34 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@cosenal @vprusso This is ready for a review up to using layerwise folding on cirq circuits.
I am working on figuring out why layerwise folding on a pyquil circuit raises errors. Once this is fixed, laywerise folding for non-cirq circuits will be added.
I think it's better to limit this PR to Cirq circuits only because I need to spend some more time understanding how the Mitiq interface decorators work. I have used the default args for the decorators in the past without any issues. This PR requires using the optional arguments.
Two different ways to implement the optional args led to errors. Either the one_to_many
argument was ignored (first code block) or _pop_measurement
was used on a Qiskit circuit instead of converting the circuit to a cirq circuit first (second code block).
@accept_qprogram_and_validate
def multivariate_layer_scaling( input_circuit, degree, ............, one_to_many = True)
Similar to how the optional arg is used in PEC, I also tried changing multivariate_layer_scaling
to _cirq_multivariate_layer_scaling
such that the new multivariate_layer_scaling
only accepted a QPROGRAM as input.
noise_scaling_func = accept_qprogram_and_validate(
_cirq_multivariate_layer_scaling,
one_to_many=True,
)
scaled_circuits = noise_scaling_func(
input_circuit, degree, fold_multiplier, num_chunks, folding_method
)
return scaled_circuits
Sounds good Purva, we can limit this PR for Cirq for now.
Except for 1 unresolved comment https://github.com/unitaryfund/mitiq/pull/2347#discussion_r1633632306, this PR is ready for another review.
This PR is ready to be merged once all checks pass.
As of 1:45 pm CST, not all checks are being run after I pushed the latest commit to this PR.
Looks like Github is aware of the issues and they are working on fixing it. https://www.githubstatus.com/
Fixes #2307
Description
License
Before opening the PR, please ensure you have completed the following where appropriate.