← Home
For problem statement at 1000-1999/1100-1199/1110-1119/1115/problemU1.txt this is a correct solution, but verifier at 1000-1999/1100-1199/1110-1119/1115/verifierU1.go ends with go run failed: exit status 1
# command-line-arguments
/tmp/build-2804264061/u1-harness-124804112.go:21:16: undefined: Qubit
/tmp/build-2804264061/u1-harness-124804112.go:33:4: undefined: AntiDiagonal

exit status 1 can you fix the verifier? package kata

func AntiDiagonalUnitary(n int) [][]complex128 {
	size := 1 << n
	u := make([][]complex128, size)
	for i := 0; i < size; i++ {
		u[i] = make([]complex128, size)
		u[i][size-1-i] = 1
	}
	return u
}

func ApplyAntiDiagonalUnitary(state []complex128) {
	for i, j := 0, len(state)-1; i < j; i, j = i+1, j-1 {
		state[i], state[j] = state[j], state[i]
	}
}