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

[Context] Halved parameter flag. #191

Merged
merged 9 commits into from
Dec 18, 2024

Conversation

ScottWe
Copy link
Contributor

@ScottWe ScottWe commented Dec 17, 2024

Summary

This pull request introduces a flag for each parameter, which identifies whether it is halved or not. A halved parameter is a symbolic parameter that can be used in gates which take parameters of the form $\theta / 2$. Examples of such gates include rx, ry, and rz.

Details

This pull request makes two changes to Quartz. First, each gate now has an is_param_halved(i) method, which returns true if parameter i is of the form $\theta / 2$. The parameter index is taken an argument, since gates such as u3 have both halved parameters and standard parameters.

This new metadata is then used by the Context to determine if any halved parameter gates are in use. If such a gate is in use, then the context conservatively assumes that the parameter will appear in a halved parameter gate.

This pull request should not change the behaviour of Quartz in any way.

Purpose

This pull request is a partial solution to issue #190. In particular, this pull request adds support for the halved_parameter flag. This is to ensure that the maintainers of Quartz are satisfied with the solution, before integrating it with the QasmParser.

Copy link
Collaborator

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@xumingkuan xumingkuan merged commit de2451a into quantum-compiler:master Dec 18, 2024
2 checks passed
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.

2 participants