I’ve gotten close to a solution, I’ve implemented the W subcircuit and the circuit quantum_model and according to the log,
Running on public test set
Test 1 of 2 failed! 🚫
Input: [[[[0.62832, 0.3927, 1.0472, 0.7854],[0.7854, 0.31416, 0.62832, 0.5236]],[[0.31416, 0.7854, 0.7854, 0.3927],[0.31416, 0.3927, 0.31416, 0.3927]]],"PauliY", 0.5236]
Expected output: [0.68594, 0.31406]
Solution output: [0.3684651333359519, 0.6315348666640477]
Failure message: Assertion Error: Something isn't quite right with the encoding block..
Test 2 of 2 failed! 🚫
Input: [[[[1.0472, 0.7854, 3.1416, 0.3927],[1.0472, 0.7854, 3.1416, 0.5236]],[[1.0472, 0.7854, 1.5708, 0.3927],[0.7854, 0.7854, 1.5708, 0.7854]]],"PauliX", 0.7854]
Expected output: [0.46653, 0.53347]
Solution output: [0.6586170165096314, 0.34138298349036755]
Failure message: Assertion Error: Something isn't quite right with the encoding block..
Meanwhile, my S function is implemented as
for _ in range(num_wires):
qml.exp(op=g(_), coeff=-0.5j*x)
I’m not sure where to go from here, there’s not a built-in function for applying matrix exponentials for all wires is there? Is looping and applying a matrix exponential for each wire a valid approach, and if so, what’s wrong with my implementation?