Open EthanObadia opened 2 weeks ago
Yes the .tensor()
method is currently mishandling the qubit support, I've also identified a different but related problem. I'm still trying to think on the best approach to solving it.
This is also relevant to the code that you have written regarding operator - operator products and promoting operators, because if we do tensor()
on a sequence that is essentially doing an operator - operator product with (potentially) different qubit support. This all needs to be harmonized.
tensor
method ofPrimitive
does not work correctly for control gates. Specifically, it fails to differentiate between different control and target qubit configurations. As a result, it incorrectly returns the same tensor for different control-target configurations of the same gate.The following code demonstrates the issue:
The function should return different tensors for
CNOT
gates with different control and target qubits. A potential fix involves ensuring the function correctly accounts for the positions of control and target qubits.