Hello all, i would like to show my idea on how to combine standard variational Circuit (VC) circuit [ Variational classifier — PennyLane] with the powerful Data-reuploading classifier [ Data-reuploading classifier — PennyLane] in order to get a more powerful circuit.
The idea is simple and you just repeat the pair of angle embedding & entangling layers. Such a pair is defined as one block (Blocks=1). The following code is a ready to use example.
Define VC-DRC circuit
Blocks = 6 #Number of repeating blocks.
layers = 1 #Number of entangling layers in each block.
@qml.qnode(dev, interface="tf", grad_method="backprop")
def qnode(inputs, weights):
for i in range(blocks):
qml.templates.AngleEmbedding(inputs, wires=range(n_qubits))
qml.templates.StronglyEntanglingLayers(weights[i], wires=range(n_qubits))
return [qml.expval(qml.PauliZ(i)) for i in range(n_qubits)]
weights_shape = (blocks, layers, n_qubits,3)
I benchmarked it in standar databases and by adding more blocks you get better classification (up to a certain point where you see no further improvement. Typically for a binary classification problem with a 2 feature dataset the circuit is not improving after Blocks=7
Let me know your thoughts.
Thanks!!