QHack 2023 challenge: A Pauli-Worded Problem

Use this topic to ask your questions about the QHack 2023 challenge: A Pauli-Worded Problem

Hello,
I have some trouble with my mixmax_trace_dist function.
Here is my code

n = len(word)
rho = np.matrix(noisy_Pauli_density(word, lmbda))
max_mixed = np.matrix(1/2**n*np.eye(n))
return np.trace(abs_dist(max_mixed, rho))

I get the error ```
unsupported operand type(s) for -: ‘DensityMatrixMP’ and ‘float’. ‘’’

Even thought I converted both operands to np.matrix.

Thanks

Hi @yoshypdf ,
You need to change several things.
For starters I suggest you check out qml.pauli.PauliWord.

I hope this helps.