Skip to content
Discussion options

You must be logged in to vote

Hi Miranda!

This error happens because when you call explicitly a gate you need to inform the total number of qudits (wires).
In your code, your QuantumGenerator class has the self.layers as:

qf.RX(dim=dim, j=0, k=1, index=range(wires))

You need to tell the number of wires as:

qf.RX(dim=dim, j=0, k=1, index=range(wires), wires=wires)

The same for all other gates in the self.layers. If you don't want to do this, alternatively, you can declare your self.layers as a circuit, then the library will know the correct number of wires and the dimension of the qudit, for instance:

self.layers = qf.Circuit(dim=dim, wires=wires)
self.layers.RX(j=0, k=1, index=range(wires))
self.layers.RX(j=1, k=2, in…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MirandaCarou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants