Skip to content

Commit 5823be3

Browse files
authored
Reorganize tests (#113)
* move ZX * move ZX * move utils * fix dir * move ZXW * fix dir * move PMG * fix dir * move ZW * fix dir * move application * fix dir * group tests * rm nightly from CI * format test files
1 parent 01b9baa commit 5823be3

24 files changed

Lines changed: 316 additions & 364 deletions

.github/workflows/CI.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
matrix:
1212
version:
1313
- '1'
14-
- 'nightly'
1514
os:
1615
- ubuntu-latest
1716
- macOS-latest
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Test, ZXCalculus, LinearAlgebra, ZXCalculus.Utils, ZXCalculus.ZXW
22
using ZXCalculus.Application:
3-
z_tensor, x_tensor, w_tensor, h_tensor, d_tensor
3+
z_tensor, x_tensor, w_tensor, h_tensor, d_tensor
44
using ZXCalculus.Utils: Parameter
55
using ZXCalculus.ZXW: push_gate!
66

@@ -20,22 +20,18 @@ using ZXCalculus.ZXW: push_gate!
2020
end
2121

2222
@testset "Convert to Einsum" begin
23-
24-
2523
zxwd = ZXWDiagram(2)
2624
push_gate!(zxwd, Val(:H), 1)
2725
push_gate!(zxwd, Val(:H), 2)
2826
push_gate!(zxwd, Val(:CZ), 1, 2)
29-
push_gate!(zxwd, Val(:X), 1, :a; autoconvert = false)
30-
push_gate!(zxwd, Val(:X), 2, :b; autoconvert = false)
27+
push_gate!(zxwd, Val(:X), 1, :a; autoconvert=false)
28+
push_gate!(zxwd, Val(:X), 2, :b; autoconvert=false)
3129
zxwd_sub = substitute_variables!(copy(zxwd), Dict(:a => 0.4, :b => 0.3))
3230
zxwd_mtx = Matrix(zxwd_sub)
3331

34-
yao_mtx = ComplexF64[
35-
0.6211468747399733+0.23776412907378838im 0.033361622447500294+0.23776412907378833im 0.1727457514062631+0.16674436811368532im -0.1727457514062631+0.642272626261262im
36-
0.1727457514062631+0.16674436811368532im 0.1727457514062631-0.642272626261262im 0.6211468747399733+0.23776412907378838im -0.033361622447500294-0.23776412907378833im
37-
0.033361622447500294+0.23776412907378833im 0.6211468747399733+0.23776412907378838im 0.1727457514062631-0.642272626261262im -0.1727457514062631-0.16674436811368532im
38-
0.1727457514062631-0.642272626261262im 0.1727457514062631+0.16674436811368532im 0.033361622447500294+0.23776412907378833im -0.6211468747399733-0.23776412907378838im
39-
]
32+
yao_mtx = ComplexF64[0.6211468747399733+0.23776412907378838im 0.033361622447500294+0.23776412907378833im 0.1727457514062631+0.16674436811368532im -0.1727457514062631+0.642272626261262im
33+
0.1727457514062631+0.16674436811368532im 0.1727457514062631-0.642272626261262im 0.6211468747399733+0.23776412907378838im -0.033361622447500294-0.23776412907378833im
34+
0.033361622447500294+0.23776412907378833im 0.6211468747399733+0.23776412907378838im 0.1727457514062631-0.642272626261262im -0.1727457514062631-0.16674436811368532im
35+
0.1727457514062631-0.642272626261262im 0.1727457514062631+0.16674436811368532im 0.033361622447500294+0.23776412907378833im -0.6211468747399733-0.23776412907378838im]
4036
@test isapprox(zxwd_mtx' * yao_mtx, Matrix{ComplexF64}((1.0 + 0.0 * im) * I, 4, 4))
4137
end

0 commit comments

Comments
 (0)