I am confused as to how to implement one_qubit_unitary function that enacts a rotation of the bloch sphere depending on the value in symbols using pennylane. Right now is my code.
def one_qubit_unitary(bit, symbols):
"""Make a circuit enacting a rotation of the bloch sphere about the X,
Y and Z axis, that depends on the values in `symbols`.
"""
qml.X(bit) ** symbols[0]
qml.Y(bit) ** symbols[1]
qml.Z(bit) ** symbols[2]
return qml.expval(qml.X(0))
The implementation in Cirq is like this and it should create a circuit like this:
def one_qubit_unitary(bit, symbols):
return cirq.Circuit( cirq.X(bit)**symbols[0], cirq.Y(bit)**symbols[1], cirq.Z(bit)**symbols[2])
I just need a bit of help in getting an equivalent circuit to work as right now I am getting type error: unsupported operand type(s) for ** or pow(): ‘X’ and ‘Symbol’.
Thanks