- qubit: dimension
- amplitude: complex number
- outcome: binary string or integer
- state: vector of amplitudes corresponding to outcomes
- single-qubit gate: pairwise linear transformation of amplitudes (e.g. X, Z)
- scaling: H
- rotation: phase
- controlled gates: transformation restricted to subsets of outcomes
- unitary matrix: matrix corresponding to state transformations
@testset "Transform (loops vs matrices)" begin
for n in 1:4
state1 = init_state(Int(n))
state2 = init_state(Int(n))
for t in 0:n - 1
transform!(state1, t, h)
transform_with_matrix!(state2, t, h)
@test state1 == state2
end
end
end