A proposed design for a VC-DRC circuit

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.


Hi @NikSchet, this is very interesting work!

I think this could make for a great demo. We would highlight it in the PennyLane Community Demos page and share it on Twitter. You can get inspiration from others that are in the page and you can ask here for guidance on how to submit it.

Also, feel free to ask any more questions you may have here.

Would you be interested on writing the demo?

Hello, thank you very much. I plan to write a demo with some results from a paper we are writting. as soon as we publish it (hopefully this week) i will start preparing a demo.

That’s great to hear @NikSchet! Good luck with your paper and the demo!

Enjoy using PennyLane :smiley:

1 Like