Skip to content

TypeError when using Qiskit plugin to convert circuit with a ParameterExpression #198

@Vivekyy

Description

@Vivekyy

Getting the following TypeError when attempting to utilize the Qiskit plugin to convert a Qiskit circuit containing a ParameterExpression:

TypeError: ParameterExpression with unbound parameters ({ParameterVectorElement(θ[0])}) cannot be cast to a float.

Code to reproduce the error:

from qiskit.circuit.library import RealAmplitudes
from torchquantum.plugins import qiskit2tq

ansatz = RealAmplitudes(2, reps=1)
tq_layer = qiskit2tq(ansatz)

Metadata

Metadata

Labels

bugSomething isn't workingenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions