diff --git a/ext/TenetQuacExt.jl b/ext/TenetQuacExt.jl index 6dd36b00..7907646c 100644 --- a/ext/TenetQuacExt.jl +++ b/ext/TenetQuacExt.jl @@ -4,7 +4,7 @@ using Tenet using Quac: Gate, Circuit, lanes, arraytype, Swap function Tenet.Quantum(gate::Gate) - return Tenet.Quantum(arraytype(gate)(gate); sites=Site[Site.(lanes(gate))..., Site.(lanes(gate); dual=true)...]) + return Tenet.Quantum(arraytype(gate)(gate), Site[Site.(lanes(gate))..., Site.(lanes(gate); dual=true)...]) end Tenet.evolve!(qtn::Ansatz, gate::Gate; kwargs...) = evolve!(qtn, Quantum(gate); kwargs...) diff --git a/test/integration/Quac_test.jl b/test/integration/Quac_test.jl index fd330214..c6fe5d23 100644 --- a/test/integration/Quac_test.jl +++ b/test/integration/Quac_test.jl @@ -1,6 +1,18 @@ @testset "Quac" begin using Quac + @testset "Gate" begin + id_gate = 2 + gate = Quac.Z(id_gate) + + qgate = Quantum(gate) + + @test nsites(qgate; set=:inputs) == 1 + @test nsites(qgate; set=:outputs) == 1 + @test issetequal(sites(qgate), [Site(id_gate), Site(id_gate; dual=true)]) + @test socket(qgate) == Operator() + end + @testset "QFT" begin n = 3 qftcirc = Quac.Algorithms.QFT(n)