Skip to content

bug: parameter name conflict #183

@Zhaoyilunnn

Description

@Zhaoyilunnn

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions