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

enable c_if for reset and raise exception if instruction does not support c_if #1868

Merged
merged 6 commits into from
Oct 10, 2023

Conversation

hhorii
Copy link
Collaborator

@hhorii hhorii commented Jul 11, 2023

Summary

Resolve #1865

Details and comments

Enable c_if for reset instructions.
Raise an exception if c_if is called for an instruction that does not support c_if.

@hhorii hhorii modified the milestones: Aer 0.12.2, Aer 0.13.0 Jul 11, 2023
elif name == "diagonal":
_check_no_conditional(name, conditional_reg)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we can support c_if for diagonal as well as reset.

aer_circ.diagonal(qubits, params, label if label else "diagonal")
elif name == "unitary":
aer_circ.unitary(qubits, params[0], conditional_reg, label if label else "unitary")
elif name == "pauli":
aer_circ.gate(name, qubits, [], params, conditional_reg, label if label else name)
elif name == "initialize":
_check_no_conditional(name, conditional_reg)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think initialize should not support c_if as well as set_* and save_*

@hhorii hhorii added the Changelog: New Feature Include in the Added section of the changelog label Jul 27, 2023
@doichanj doichanj merged commit 94377f8 into Qiskit:main Oct 10, 2023
31 checks passed
doichanj pushed a commit to doichanj/qiskit-aer that referenced this pull request Oct 26, 2023
…upport `c_if` (Qiskit#1868)

* enable c_if for reset and raise exception if instruction does not support c_if

* add reno

* use correct conditional_reg for reset

* support c_if for diagonal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong outcome using c_if on simulator
2 participants