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

Provide option to assume zero initial state in ansatz generation #10

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

garrison
Copy link
Member

@garrison garrison commented Nov 2, 2024

The ansatz begins with ZXZ decompositions, but the first RZGate on each qubit has no effect if acting on the initial state. So, this adds an option to remove that parameter on each qubit.

It's left as an option since it does not make sure to do in the case of unitary AQC.

Right now the option is called assume_initial_zero_state. I'm definitely open to discussing the name of the option.

TODO

  • add new argument to docstring - will do this in follow-up PR
  • use this flag in the tutorial and tests

The ansatz begins with ZXZ decompositions, but the first RZGate
on each qubit has no effect if acting on the initial state.  So,
this adds an option to remove that parameter on each qubit.

It's left as an option since it does not make sure to do in the case
of unitary AQC.

I'm definitely open to discussing the name of the option.

TODO

- [ ] add new argument to docstring
@garrison garrison added enhancement New feature or request ansatz generation labels Nov 2, 2024
@coveralls
Copy link

coveralls commented Nov 2, 2024

Pull Request Test Coverage Report for Build 11669669549

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 95.39%

Totals Coverage Status
Change from base Build 11638757861: 0.4%
Covered Lines: 600
Relevant Lines: 629

💛 - Coveralls

@garrison
Copy link
Member Author

garrison commented Nov 4, 2024

@jakelishman has informed me of Qiskit/qiskit#12911, which used the name qubits_initially_zero for this concept. I like that name better and will update this PR shortly.

@garrison garrison merged commit ca9f741 into main Nov 4, 2024
14 checks passed
@garrison garrison deleted the ansatz-xz-zxz-zxz branch November 4, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansatz generation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants