-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add placeholder for doc imporvement * relocate utils and zx into own module * port most of ZXW * finish porting ZXW * finish all porting * change docs * fix docs not building issue * restructure module folders * add usings to each test file * replace import with using
- Loading branch information
Showing
53 changed files
with
547 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,148 +1,6 @@ | ||
# APIs | ||
|
||
```@meta | ||
CurrentModule = ZXCalculus | ||
```@autodocs | ||
Modules = [ZXCalculus, ZXCalculus.ZX, ZXCalculus.ZXW, ZXCalculus.ZW, ZXCalculus.Utils, ZXCalculus.PMG] | ||
Order = [:function, :type] | ||
``` | ||
|
||
## ZX-diagrams | ||
|
||
```@docs | ||
ZXCalculus.ZXDiagram | ||
ZXDiagram(nbit::Int) | ||
ZXCalculus.ZXGraph | ||
ZXCalculus.ZXGraph(::ZXDiagram) | ||
ZXCalculus.ZXLayout | ||
ZXCalculus.qubit_loc | ||
spider_type(zxd::ZXDiagram{T, P}, v::T) where {T<:Integer, P} | ||
ZXCalculus.phase(zxd::ZXDiagram{T, P}, v::T) where {T<:Integer, P} | ||
Graphs.nv(zxd::ZXDiagram) | ||
Graphs.ne(::ZXDiagram) | ||
Graphs.neighbors(::ZXDiagram, v) | ||
ZXCalculus.is_interior(zxg::ZXGraph{T, P}, v::T) where {T, P} | ||
ZXCalculus.add_spider! | ||
ZXCalculus.insert_spider! | ||
ZXCalculus.rem_spiders! | ||
ZXCalculus.rem_spider! | ||
``` | ||
|
||
## Pushing gates | ||
```@docs | ||
ZXCalculus.push_gate! | ||
ZXCalculus.pushfirst_gate! | ||
``` | ||
|
||
## Simplification | ||
```@docs | ||
ZXCalculus.phase_teleportation | ||
ZXCalculus.clifford_simplification | ||
Rule{L} where L | ||
ZXCalculus.simplify! | ||
ZXCalculus.replace! | ||
ZXCalculus.match | ||
ZXCalculus.rewrite! | ||
ZXCalculus.Match | ||
``` | ||
|
||
## Circuit extraction | ||
```@docs | ||
ZXCalculus.circuit_extraction(zxg::ZXGraph{T, P}) where {T, P} | ||
``` | ||
|
||
## ZXW-diagram | ||
```@docs | ||
ZXCalculus.ZXW.add_inout! | ||
ZXCalculus.ZXW.substitute_variables! | ||
ZXCalculus.biadjacency | ||
ZXCalculus.ZXW.rem_spider! | ||
ZXCalculus.continued_fraction | ||
ZXCalculus.ZXW.symbol_vertices | ||
ZXCalculus.ZXW.dagger | ||
ZXCalculus.ZXW.add_spider! | ||
ZXCalculus.tcount | ||
ZXCalculus.Phase | ||
ZXCalculus.round_phases! | ||
ZXCalculus.gaussian_elimination | ||
ZXCalculus.Scalar | ||
ZXCalculus.ZXW.expval_circ! | ||
Graphs.SimpleGraphs.rem_edge! | ||
ZXCalculus.ZXW.parameter | ||
ZXCalculus.ZXW.int_prep! | ||
ZXCalculus.update_frontier! | ||
ZXCalculus.ZXW.integrate! | ||
ZXCalculus.set_column! | ||
ZXCalculus.set_phase! | ||
ZXCalculus.prev | ||
ZXCalculus.ancilla_extraction | ||
Graphs.SimpleGraphs.add_edge! | ||
ZXCalculus.ZXW.stack_zxwd! | ||
ZXCalculus.ZXW.get_outputs | ||
ZXCalculus.scalar | ||
ZXCalculus.get_inputs | ||
ZXCalculus.ZW.get_inputs | ||
ZXCalculus.column_loc | ||
ZXCalculus.GEStep | ||
ZXCalculus.ZXW.spider_type | ||
ZXCalculus.ZXW.print_spider | ||
ZXCalculus.ZXW.Parameter | ||
ZXCalculus.ZXW.nqubits | ||
ZXCalculus.set_qubit! | ||
ZXCalculus.ZXW.insert_wtrig! | ||
ZXCalculus.ZXW.concat! | ||
ZXCalculus.ZXW.rem_spiders! | ||
ZXCalculus.ZXW.insert_spider! | ||
ZXCalculus.set_loc! | ||
ZXCalculus.spiders | ||
ZXCalculus.split_edge! | ||
ZXCalculus.ZXW.import_edges! | ||
ZXCalculus.get_outputs | ||
ZXCalculus.ZXW.get_inputs | ||
ZXCalculus.ZXW.import_non_in_out! | ||
ZXCalculus.ZXW.set_phase! | ||
ZXCalculus.ZXW.nout | ||
``` | ||
|
||
# Planar Multigraph | ||
```@docs | ||
ZXCalculus.PlanarMultigraph | ||
ZXCalculus.is_boundary | ||
ZXCalculus.trace_face | ||
ZXCalculus.new_edge | ||
ZXCalculus.ϕ | ||
ZXCalculus.nqubits | ||
ZXCalculus.erase_facet! | ||
ZXCalculus.create_face! | ||
ZXCalculus.surrounding_half_edge | ||
ZXCalculus.add_facet_to_boarder! | ||
ZXCalculus.split_facet! | ||
ZXCalculus.split_vertex! | ||
ZXCalculus.add_vertex_and_facet_to_boarder! | ||
ZXCalculus.create_edge! | ||
ZXCalculus.join_facet! | ||
ZXCalculus.create_vertex! | ||
ZXCalculus.σ_inv | ||
ZXCalculus.σ | ||
ZXCalculus.make_hole! | ||
ZXCalculus.gc_vertex! | ||
ZXCalculus.HalfEdge | ||
ZXCalculus.out_half_edge | ||
ZXCalculus.n_conn_comp | ||
ZXCalculus.join_vertex! | ||
``` | ||
|
||
# ZW-diagrams | ||
```@docs | ||
ZXCalculus.ZW.ZWDiagram | ||
ZXCalculus.ZW.insert_spider! | ||
ZXCalculus.ZW.get_output_idx | ||
ZXCalculus.ZW.nqubits | ||
ZXCalculus.ZW.round_phases! | ||
ZXCalculus.ZW.nout | ||
ZXCalculus.ZW.get_input_idx | ||
ZXCalculus.ZW.set_phase! | ||
ZXCalculus.ZW.get_outputs | ||
ZXCalculus.ZW.add_spider! | ||
ZXCalculus.ZW.parameter | ||
ZXCalculus.ZW.print_spider | ||
ZXCalculus.ZW.spider_type | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Application | ||
|
||
using OMEinsum, MLStyle | ||
using ..ZXW: ZXWDiagram, Z, X, W, H, D, Input, Output | ||
using ..Utils: PiUnit, Factor, Parameter, unwrap_scalar | ||
using ..ZXW: get_outputs, get_inputs, degree, neighbors, vertices, scalar, nin, nout | ||
|
||
include("to_eincode.jl") | ||
end # module Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module PMG | ||
|
||
using Graphs | ||
|
||
import Graphs: AbstractEdge, src, dst, nv, ne, neighbors | ||
import Graphs.SimpleGraphs: vertices | ||
|
||
export HalfEdge, src, dst, new_edge, PlanarMultigraph | ||
|
||
include("planar_multigraph.jl") | ||
|
||
end # module PlanarMultigraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module Utils | ||
|
||
using Expronicon.ADT: @const_use, @adt | ||
using MLStyle | ||
|
||
include("scalar.jl") | ||
include("phase.jl") | ||
include("parameter.jl") | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export Scalar | ||
|
||
""" | ||
Scalar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module ZW | ||
using Expronicon.ADT: @adt, @const_use | ||
using MLStyle, Graphs | ||
using ..ZXW: _round_phase, Parameter | ||
|
||
# these will be changed to using PlanarMultigraph: vertices after we split out package | ||
using ..PMG: | ||
vertices, | ||
nv, | ||
has_vertex, | ||
ne, | ||
neighbors, | ||
rem_edge!, | ||
add_edge!, | ||
degree, | ||
next, | ||
split_vertex!, | ||
split_edge!, | ||
face, | ||
trace_face, | ||
make_hole!, | ||
add_vertex_and_facet_to_boarder!, | ||
split_facet!, | ||
twin, | ||
prev, | ||
add_multiedge!, | ||
join_facet!, | ||
trace_vertex, | ||
join_vertex! | ||
|
||
# these remains | ||
using ..Utils: add_phase!, Scalar, Phase, Parameter, PiUnit, Factor, add_power! | ||
using ..PMG: PlanarMultigraph, HalfEdge, new_edge, src, dst | ||
import ..Utils: add_power! | ||
import ..ZX: add_global_phase!, scalar, spiders, rem_spider! | ||
import Graphs.rem_edge! | ||
|
||
export ZWDiagram | ||
|
||
include("zw_adt.jl") | ||
include("zw_diagram.jl") | ||
include("zw_utils.jl") | ||
end # module ZW |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.