Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: parameter name conflict #183

Open
Zhaoyilunnn opened this issue Aug 12, 2024 · 0 comments
Open

bug: parameter name conflict #183

Zhaoyilunnn opened this issue Aug 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Zhaoyilunnn
Copy link
Collaborator

Currently, when creating quantum neural network, it is user's responsibility to ensure there's no name conflict among all parameters.

For example, user has to make sure to use "phi" rather than "theta" since "theta" is used in entangler layer

  # customize encoder layer
>>ry0 = qeg.RYGate(0, Parameter("phi_0", inputs0[0], tunable=False))
>>ry1 = qeg.RYGate(0, Parameter("phi_1", inputs0[1], tunable=False))
>>x = qeg.XGate(1)
>>cnot = qeg.CXGate(0, 1)
>>rx0 = qeg.RYGate(0, Parameter("phi_3", inputs0[2], tunable=False))
>>rx1 = qeg.RYGate(0, Parameter("phi_4", inputs0[3], tunable=False))
  # encoder_layer = [ry0, ry1, x, cnot, rx0, rx1]
  encoder_layer = [ry0, ry1, x]

  entangle_layer = BasicEntangleLayers(weights, num_qubits=num_qubits)
  qnn1 = QuantumNeuralNetwork(num_qubits, encoder_layer + entangle_layer)
@Zhaoyilunnn Zhaoyilunnn added the bug Something isn't working label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant