eclipse-qrisp / Qrisp

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

Bug: statevector for parametrized circuit #44

Open renezander90 opened 5 months ago

renezander90 commented 5 months ago

Consider the following example:

from qrisp import QuantumArray, QuantumVariable, rzz
import numpy as np
from sympy import Symbol

M=2
N=2
qtype = QuantumVariable(2)
q_array = QuantumArray(qtype = qtype, shape = (M))

gamma = [Symbol("gamma_" + str(i)) for i in range(1)]

rzz(gamma[0],q_array[0][1],q_array[1][0])
rzz(gamma[0],q_array[0][1],q_array[1][1])

qc=q_array.qs.compile() #parameterized compiling
sv_array = qc.statevector_array()

This yields "TypeError: cannot determine truth value of Relational". The same error occurs for "sv = q_array.qs.statevector()" (with a different error message). The error seems to be related to two rzz gates acting on the same qubit.