1
$\begingroup$

I am trying to build two qudit CX (d-dim) gate. enter image description here

and getting below error. enter image description here

There is no issue in the unitary matrix. Please suggest to resolve the error.

$\endgroup$

1 Answer 1

1
$\begingroup$

_qid_shape_ should return (self.d, self.d) instead of (self.d * self.d,). You're currently asking or one $d^2$-level object instead of two $d$-level objects.

If you specify qid shape, you don't have to specify num qubits.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.