eclipse-qrisp / Qrisp

Qrisp - a framework for high-level programming of Quantum computers
https://www.qrisp.eu/
Eclipse Public License 2.0
92 stars 26 forks source link

Applying simple gates on QuantumArray #3

Closed wzpxq closed 1 year ago

wzpxq commented 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()]

positr0nium commented 1 year ago

That's a good Idea! We will include it in our next update.

positr0nium commented 1 year ago

This works now with 0.2.