Return the quantum fidelity between pure states.

def state_fidelity(state0: State, state1: State) -> bk.BKTensor:
    """Return the quantum fidelity between pure states."""
    assert state0.qubits == state1.qubits   # FIXME
    tensor = bk.absolute(bk.inner(state0.tensor, state1.tensor))**bk.fcast(2)
    return tensor