Closed Roger-luo closed 1 year ago
θ = 0.5
@test mat(Rz(θ) * phase(θ/2)) ≈ ztensor(2, θ)
@test mat(Rx(θ) * phase(θ/2)) ≈ xtensor(2, θ)
@test mat(H) .* sqrt(2) ≈ htensor(2, π)
@test mat(shift(θ)) ≈ ztensor(2, θ)
Some identities
θ = 0.5
@test mat(Rz(θ) * Yao.phase(θ/2)) ≈ ztensor(2, θ)
@test mat(shift(θ)) ≈ ztensor(2, θ)
@test mat(Rx(θ) * Yao.phase(θ/2)) ≈ xtensor(2, θ)
@test mat(H) .* sqrt(2) ≈ htensor(2, π)
@test mat(T) ≈ ztensor(2, π/4)
@test mat(ConstGate.S) ≈ ztensor(2, π/2)
@test mat(chain(ConstGate.Sdag, X, ConstGate.S)) ≈ mat(Y)
@test mat(T) ≈ mat(Rz(π/4) * Yao.phase(π/8))
@test mat(ConstGate.S) ≈ mat(Rz(π/2) * Yao.phase(π/4))
For more, see https://github.com/QuantumBFS/YaoZX.jl
This is implemented in #93 albeit for zxw diagram. I will close this for now.
Might be useful in the future.