```
@qml.qnode(dev)
def circuit1(x1, x2):
qml.Hadamard(wires=0)
qml.U3(2*pi, 0, 0, wires=[0]) #first gate
qml.U3(pi, -pi/2, pi/2, wires=[1])
qml.U3(2*pi, 0, 0, wires=[0]) #second gate
qml.U3(pi, -pi/2, pi/2, wires=[2])
qml.U3(2*pi, 0, 0, wires=[0]) #third gate
qml.U3(pi, -pi/2, pi/2, wires=[3])
#qml.U3(2*pi, 0, 0, wires=[0]) #fourth
#qml.U3(pi, -pi/2, pi/2, wires=[4])
#qml.U3(2*pi, 0, 0, wires=[0]) #fifth gate
#qml.U3(pi, -pi/2, pi/2, wires=[5])
qml.templates.MottonenStatePreparation(x1, wires=[1, 2, 3])
#qml.U3(2*pi, 0, 0, wires=[0]) #first gate
#qml.U3(pi, -pi/2, pi/2, wires=[5])
#qml.U3(2*pi, 0, 0, wires=[0]) #second gate
#qml.U3(pi, -pi/2, pi/2, wires=[4])
qml.U3(2*pi, 0, 0, wires=[0]) #third gate
qml.U3(pi, -pi/2, pi/2, wires=[3])
qml.U3(2*pi, 0, 0, wires=[0]) #fourth gate
qml.U3(pi, -pi/2, pi/2, wires=[2])
qml.U3(2*pi, 0, 0, wires=[0]) #fifth gate
qml.U3(pi, -pi/2, pi/2, wires=[1])
qml.U3(pi, 0, pi, wires=0)
qml.U3(2*pi, 0, 0, wires=[0]) #first gate
qml.U3(pi, -pi/2, pi/2, wires=[1])
qml.U3(2*pi, 0, 0, wires=[0]) #second gate
qml.U3(pi, -pi/2, pi/2, wires=[2])
qml.U3(2*pi, 0, 0, wires=[0]) #third gate
qml.U3(pi, -pi/2, pi/2, wires=[3])
#qml.U3(2*pi, 0, 0, wires=[0]) #fourth
#qml.U3(pi, -pi/2, pi/2, wires=[4])
#qml.U3(2*pi, 0, 0, wires=[0]) #fifth gate
#qml.U3(pi, -pi/2, pi/2, wires=[5])
qml.templates.MottonenStatePreparation(x2, wires=[1, 2, 3])
#qml.U3(2*pi, 0, 0, wires=[0]) #first gate
#qml.U3(pi, -pi/2, pi/2, wires=[5])
#qml.U3(2*pi, 0, 0, wires=[0]) #second gate
#qml.U3(pi, -pi/2, pi/2, wires=[4])
qml.U3(2*pi, 0, 0, wires=[0]) #third gate
qml.U3(pi, -pi/2, pi/2, wires=[3])
qml.U3(2*pi, 0, 0, wires=[0]) #fourth gate
qml.U3(pi, -pi/2, pi/2, wires=[2])
qml.U3(2*pi, 0, 0, wires=[0]) #fifth gate
qml.U3(pi, -pi/2, pi/2, wires=[1])
qml.U3(pi, 0, pi, wires=0)
qml.Hadamard(wires=0)
return qml.expval(qml.PauliZ(0))
```

i had to use u3 gate.