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

[Capture] Switch from binding qnode_kwargs to execution_config #6991

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Feb 21, 2025

Context:

As the capture workflow is getting more complicated, we should start using the well-defined ExecutionConfig object instead of the ambiguous and unspecified qnode_kwargs.

We also need to start passing the execution_config to the device, as that information is needed for handling mid circuit measurements.

Description of the Change:

Switches from binding a qnode_kwargs dictionary to an execution_config object.

Benefits:

Easier to manage the configuration of a workflow. Can specify MCM configuration info for device execution.

Possible Drawbacks:

Technically a breaking change, but a breaking change to an experimental project.

Related GitHub Issues:

[sc-84916]

@albi3ro albi3ro marked this pull request as ready for review February 21, 2025 15:56
Comment on lines 133 to 138
expected_config = qml.devices.ExecutionConfig(
gradient_method="best",
gradient_keyword_arguments={},
use_device_jacobian_product=False,
interface="jax",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also use construct_execution_config here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using it in the source code, but just being a bit more manual in the tests.

Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

Should this PR also update DefaultQubitInterpreter to accept ExecutionConfig? It's not really used for anything inside the device yet, so I'm okay with doing it in #6961 as well.

@albi3ro
Copy link
Contributor Author

albi3ro commented Feb 21, 2025

Should this PR also update DefaultQubitInterpreter to accept ExecutionConfig? It's not really used for anything inside the device yet, so I'm okay with doing it in #6961 as well.

I'm fine either way, but I think that it makes sense in #6961 since that's when it actually starts using it.

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