Skip to content

apply_gate() results mismatch with qiskit? #89

Answered by mtjrider
wcqc asked this question in Q&A
Discussion options

You must be logged in to vote

@wcqc yes. When the gate is not decomposed, you must provide both controls and targets to targets=[] where you’ve taken care in the relative qubit index ordering to preserve the role of the controls.

We tend to prefer option 2 as it provides more composability— gates can be fused, reordered, etc..

The assumption we make in the apply_matrix API is that the gate is numerically dense. We have other APIs for when the gate takes a special form (e.g.) Pauli matrices, diagonal gates, rotations, etc.

I’ll add that there are cases when fusing the control in this fashion can be advantageous. It allows you to fuse 1-qubit gates on either qubit before and after the CX. Fusion is useful because it inc…

Replies: 2 comments 13 replies

Comment options

You must be logged in to vote
9 replies
@wcqc
Comment options

@mtjrider
Comment options

Answer selected by wcqc
@wcqc
Comment options

@mtjrider
Comment options

@wcqc
Comment options

@mtjrider
Comment options

Comment options

You must be logged in to vote
4 replies
@wcqc
Comment options

@mtjrider
Comment options

@wcqc
Comment options

@mtjrider
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants