Skip to content

Instantly share code, notes, and snippets.

View ChenZhao44's full-sized avatar

Chen Zhao ChenZhao44

  • Harvard University
  • Cambridge, MA
  • 17:25 (UTC -04:00)
View GitHub Profile
@ChenZhao44
ChenZhao44 / zx_vega.jl
Created September 14, 2021 08:10
Vega plots for ZX-diagram
using Vega
vg"""
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 200,
"height": 100,
"padding": 20,
"autosize": "none",
"signals": [
@ChenZhao44
ChenZhao44 / Metatheory_GATExpr.jl
Created April 22, 2021 07:54
Rewrite GATExpr with Metatheory.jl
using Catlab
using Catlab.Theories
@signature ZXCategory{Ob,Hom} <: DaggerCompactCategory{Ob,Hom} begin
# Argument α is the phase, usually <: Real
zphase(A::Ob, α)::(A → A)
zcopy(A::Ob, α)::(A → (A⊗A))
zdelete(A::Ob, α)::(A → munit())
zmerge(A::Ob, α)::((A⊗A) → A)
zcreate(A::Ob, α)::(munit() → A)