The grader checks
def run(test_case_input: str) -> str:
ins = json.loads(test_case_input)
out_state = qsvt_diffusion(*ins)[:4]
rescaled_out= out_state * np.linalg.norm(b) / C
output = rescaled_out/ np.linalg.norm(rescaled_out)
return str(np.real(output).tolist())
There seems to be an error here.
rescaled_outis redundant because it is immediately normalised in the next line.outputis a normalised state, butnp.real(output)is returned. Unless the state is already completely real, the returned state will not be normalised. However, the answers of the public testcases are normalised states.
I believe the correct order should be: taking np.real first, and then normalising afterwards.
Thanks.