Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of ZW Diagram #99

Merged
merged 23 commits into from
Oct 6, 2023
Merged

Implementation of ZW Diagram #99

merged 23 commits into from
Oct 6, 2023

Conversation

exAClior
Copy link
Collaborator

Start to implement ZWDiagram from Planar Multigraph data structure.

I try to implement the following ADTs that are generators of pW fragment, fragment for local fermionic mode quantum computer, universal quantum computer fragment.

  1. binary Z spider + W spider + fSWAP
    • SWAP
    • one-nary Z spider

It should be noted that I need to prove that binary Z spider and one-nary Z spider together with other generators can generate n-nary Z spider.

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Attention: 73 lines in your changes are missing coverage. Please review.

Files Coverage Δ
src/ZXCalculus.jl 100.00% <100.00%> (ø)
src/parameter.jl 77.67% <ø> (ø)
src/zw_adt.jl 75.00% <75.00%> (ø)
src/zw_diagram.jl 96.51% <96.51%> (ø)
src/zw_utils.jl 78.10% <78.10%> (ø)
src/planar_multigraph.jl 78.60% <47.29%> (-6.71%) ⬇️

... and 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@exAClior exAClior marked this pull request as ready for review September 23, 2023 07:58
@exAClior exAClior marked this pull request as draft September 26, 2023 15:35
@exAClior exAClior marked this pull request as ready for review September 27, 2023 07:11
@exAClior
Copy link
Collaborator Author

I have sorted functions in docs based on their module. There is still a tcount function left in the api.md. It is currently been referenced in example.md I will remove it after modifying the documentation.

Copy link
Member

@ChenZhao44 ChenZhao44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this pull request is great overall. I only have a few minor comments to make.

src/parameter.jl Outdated
@@ -1,3 +1,5 @@
using .ZXW:Parameter, PiUnit, Factor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a space is missing after :

pmg2::PlanarMultigraph{T},
verbose::Bool,
) where {T<:Integer}
function print_nonoverlaping(dict1, dict2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to move these functions outside of ==?

end

end
function equiv_v2he(pmg1::PlanarMultigraph, pmg2::PlanarMultigraph)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

return false
end
if nhe(pmg1) != nhe(pmg2)

function equiv_f2he(pmg1::PlanarMultigraph, pmg2::PlanarMultigraph)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

ZWDiagram(
pmg::PlanarMultigraph{T},
st::Dict{T,ZWSpiderType},
P::Type = Rational,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to change the function arguments to ZWDiagram(pmg::PlanarMultigraph{T}, st::Dict{T, ZWSpiderType}, scalar::Scalar{P}) so that the user can customize the scalar?

ZWDiagram(
pmg::PlanarMultigraph{T},
st::Vector{ZWSpiderType},
P::Type = Rational,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

src/zw_utils.jl Outdated
binZ(p) => p
monoZ(p) => p
Input(q) || Output(q) => q
_ => Parameter(Val(:PiUnit), 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return nothing here?

src/zw_utils.jl Outdated
add_spider!(zwd, spider, connect = [])

Add a new spider `spider` with appropriate parameter
connected to the half edges`connect`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a missing space before connect

@ChenZhao44 ChenZhao44 merged commit 6cbafe4 into master Oct 6, 2023
15 of 17 checks passed
@ChenZhao44 ChenZhao44 deleted the pw-diagram branch October 6, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants