Closed wzpxq closed 1 year ago
It would be great, if applying gate functions (e.g. x(...) or h(...)) would be possible on QuantumArrays (as for other QuantumVariables), like:
a = QuantumArray(qtype = QuantumFloat(2, -2), shape = (2,2)) x(a)
which does not compile unfortunately.
Why not apply x to all qubits in a if x(a) is performed such that it does the same as: [x(i) for i in a.flatten()]
x
a
x(a)
[x(i) for i in a.flatten()]
That's a good Idea! We will include it in our next update.
This works now with 0.2.
It would be great, if applying gate functions (e.g. x(...) or h(...)) would be possible on QuantumArrays (as for other QuantumVariables), like:
which does not compile unfortunately.
Why not apply
x
to all qubits ina
ifx(a)
is performed such that it does the same as:[x(i) for i in a.flatten()]