barton@grothendieck ~ % flox activate
flox [default] barton@grothendieck ~ % julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
(@v1.10) pkg> add Catlab
Installing known registries into `~/.julia`
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
Installed Crayons ───────────────────── v4.1.1
Installed XML2_jll ──────────────────── v2.12.2+0
Installed Preferences ───────────────── v1.4.1
Installed ColorTypes ────────────────── v0.11.4
Installed JSON ──────────────────────── v0.21.4
Installed GATlab ────────────────────── v0.1.0
Installed JSON3 ─────────────────────── v1.14.0
Installed TableTraits ───────────────── v1.0.1
Installed Parsers ───────────────────── v2.8.1
Installed Permutations ──────────────── v0.4.20
Installed Tables ────────────────────── v1.11.1
Installed IterTools ─────────────────── v1.10.0
Installed DataAPI ───────────────────── v1.16.0
Installed FixedPointNumbers ─────────── v0.8.4
Installed Measures ──────────────────── v0.3.2
Installed PrettyTables ──────────────── v2.3.1
Installed IteratorInterfaceExtensions ─ v1.0.0
Installed StaticArraysCore ──────────── v1.4.2
Installed JLLWrappers ───────────────── v1.5.0
Installed StaticArrays ──────────────── v1.9.2
Installed PrecompileTools ───────────── v1.2.0
Installed GeneralizedGenerated ──────── v0.3.3
Installed Libiconv_jll ──────────────── v1.17.0+0
Installed DataValueInterfaces ───────── v1.0.0
Installed OrderedCollections ────────── v1.6.3
Installed NameResolution ────────────── v0.1.5
Installed ACSets ────────────────────── v0.2.13
Installed LaTeXStrings ──────────────── v1.3.1
Installed CompTime ──────────────────── v0.1.2
Installed AlgebraicInterfaces ───────── v0.1.1
Installed Combinatorics ─────────────── v1.0.2
Installed Catlab ────────────────────── v0.16.7
Installed Reexport ──────────────────── v1.2.2
Installed DataStructures ────────────── v0.18.16
Installed Requires ──────────────────── v1.3.0
Installed Colors ────────────────────── v0.12.10
Installed StructEquality ────────────── v2.1.0
Installed MacroTools ────────────────── v0.5.13
Installed PrettyPrint ───────────────── v0.2.0
Installed Compat ────────────────────── v4.12.0
Installed MLStyle ───────────────────── v0.4.17
Installed LightXML ──────────────────── v0.9.1
Installed JuliaVariables ────────────── v0.2.4
Installed StringManipulation ────────── v0.3.4
Installed Compose ───────────────────── v0.9.5
Installed StructTypes ───────────────── v1.10.0
Downloaded artifact: XML2
Downloaded artifact: Libiconv
Updating `~/.julia/environments/v1.10/Project.toml`
[134e5e36] + Catlab v0.16.7
Updating `~/.julia/environments/v1.10/Manifest.toml`
[227ef7b5] + ACSets v0.2.13
[23cfdc9f] + AlgebraicInterfaces v0.1.1
[134e5e36] + Catlab v0.16.7
[3da002f7] + ColorTypes v0.11.4
[5ae59095] + Colors v0.12.10
[861a8166] + Combinatorics v1.0.2
[0fb5dd42] + CompTime v0.1.2
[34da2185] + Compat v4.12.0
[a81c6b42] + Compose v0.9.5
[a8cc5b0e] + Crayons v4.1.1
[9a962f9c] + DataAPI v1.16.0
[864edb3b] + DataStructures v0.18.16
[e2d170a0] + DataValueInterfaces v1.0.0
[53c48c17] + FixedPointNumbers v0.8.4
[f0ffcf3b] + GATlab v0.1.0
[6b9d7cbe] + GeneralizedGenerated v0.3.3
[c8e1da08] + IterTools v1.10.0
[82899510] + IteratorInterfaceExtensions v1.0.0
[692b3bcd] + JLLWrappers v1.5.0
[682c06a0] + JSON v0.21.4
[0f8b85d8] + JSON3 v1.14.0
[b14d175d] + JuliaVariables v0.2.4
[b964fa9f] + LaTeXStrings v1.3.1
[9c8b4983] + LightXML v0.9.1
[d8e11817] + MLStyle v0.4.17
[1914dd2f] + MacroTools v0.5.13
[442fdcdd] + Measures v0.3.2
[71a1bf82] + NameResolution v0.1.5
[bac558e1] + OrderedCollections v1.6.3
[69de0a69] + Parsers v2.8.1
[2ae35dd2] + Permutations v0.4.20
[aea7be01] + PrecompileTools v1.2.0
[21216c6a] + Preferences v1.4.1
[8162dcfd] + PrettyPrint v0.2.0
[08abe8d2] + PrettyTables v2.3.1
[189a3867] + Reexport v1.2.2
[ae029012] + Requires v1.3.0
[90137ffa] + StaticArrays v1.9.2
[1e83bf80] + StaticArraysCore v1.4.2
[892a3eda] + StringManipulation v0.3.4
[6ec83bb0] + StructEquality v2.1.0
[856f2bd8] + StructTypes v1.10.0
[3783bdb8] + TableTraits v1.0.1
[bd369af6] + Tables v1.11.1
[94ce4f54] + Libiconv_jll v1.17.0+0
[02c8fc9c] + XML2_jll v2.12.2+0
[0dad84c5] + ArgTools v1.1.1
[56f22d72] + Artifacts
[2a0f44e3] + Base64
[ade2ca70] + Dates
[f43a241f] + Downloads v1.6.0
[7b1f6079] + FileWatching
[b77e0a4c] + InteractiveUtils
[b27032c2] + LibCURL v0.6.4
[76f85450] + LibGit2
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[56ddb016] + Logging
[d6f4376e] + Markdown
[a63ad114] + Mmap
[ca575930] + NetworkOptions v1.2.0
[44cfe95a] + Pkg v1.10.0
[de0858da] + Printf
[3fa0cd96] + REPL
[9a3f8284] + Random
[ea8e919c] + SHA v0.7.0
[9e88b42a] + Serialization
[6462fe0b] + Sockets
[2f01184e] + SparseArrays v1.10.0
[10745b16] + Statistics v1.10.0
[fa267f1f] + TOML v1.0.3
[a4e569a6] + Tar v1.10.0
[cf7118a7] + UUIDs
[4ec0a83e] + Unicode
[e66e0078] + CompilerSupportLibraries_jll v1.0.5+1
[deac9b47] + LibCURL_jll v8.4.0+0
[e37daf67] + LibGit2_jll v1.6.4+0
[29816b5a] + LibSSH2_jll v1.11.0+1
[c8ffd9c3] + MbedTLS_jll v2.28.2+1
[14a3606d] + MozillaCACerts_jll v2023.1.10
[4536629a] + OpenBLAS_jll v0.3.23+2
[bea87d4a] + SuiteSparse_jll v7.2.1+1
[83775a58] + Zlib_jll v1.2.13+1
[8e850b90] + libblastrampoline_jll v5.8.0+1
[8e850ede] + nghttp2_jll v1.52.0+1
[3f19e933] + p7zip_jll v17.4.0+2
Precompiling project...
50 dependencies successfully precompiled in 31 seconds. 3 already precompiled.
(@v1.10) pkg>
flox [default] barton@grothendieck ~ % julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Catlab.Theories
julia> A, B, C, D = Ob(FreeBiproductCategory, :A, :B, :C, :D)
4-element Vector{Catlab.Theories.FreeBiproductCategory.Ob{:generator}}:
A
B
C
D
julia> f = Hom(:f, A, B)
f: A → B
julia> g = Hom(:g, B, C)
g: B → C
julia> h = Hom(:h, C, D)
h: C → D
julia> f
f: A → B
julia> f
f: A → B
julia> f, g, h = to_wiring_diagram(f), to_wiring_diagram(g), to_wiring_diagram(h)
ERROR: UndefVarError: `to_wiring_diagram` not defined
Stacktrace:
[1] top-level scope
@ REPL[7]:1
julia> using Catlab.WiringDiagrams
julia> using Catlab.Graphics
julia> import Catlab.Graphics: Graphviz
julia> show_diagram(d::WiringDiagram) = to_graphviz(d,
orientation=LeftToRight,
labels=true, label_attr=:xlabel,
node_attrs=Graphviz.Attributes(
:fontname => "Courier",
),
edge_attrs=Graphviz.Attributes(
:fontname => "Courier",
)
)
show_diagram (generic function with 1 method)
julia> f, g, h = to_wiring_diagram(f), to_wiring_diagram(g), to_wiring_diagram(h)
(WiringDiagram{Catlab.Theories.ThBiproductCategory.Meta.T}([:A], [:B],
[ -2 => {inputs},
-1 => {outputs},
1 => Box(:f, [:A], [:B]) ],
[ Wire((-2,1) => (1,1)),
Wire((1,1) => (-1,1)) ]), WiringDiagram{Catlab.Theories.ThBiproductCategory.Meta.T}([:B], [:C],
[ -2 => {inputs},
-1 => {outputs},
1 => Box(:g, [:B], [:C]) ],
[ Wire((-2,1) => (1,1)),
Wire((1,1) => (-1,1)) ]), WiringDiagram{Catlab.Theories.ThBiproductCategory.Meta.T}([:C], [:D],
[ -2 => {inputs},
-1 => {outputs},
1 => Box(:h, [:C], [:D]) ],
[ Wire((-2,1) => (1,1)),
Wire((1,1) => (-1,1)) ]))
julia> show_diagram(f)
Catlab.Graphics.Graphviz.Graph("G", true, "dot", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Subgraph("", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node("n0in1", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:id => "in1"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rank => "source", :rankdir => "TB"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:style => "invis", :shape => "none", :label => "", :width => "0", :height => "0.333"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:style => "invis")), Catlab.Graphics.Graphviz.Subgraph("", Catlab.Graphics.Graphviz.Statement[Catlab.Graphics.Graphviz.Node("n0out1", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:id => "out1"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:rank => "sink", :rankdir => "TB"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:style => "invis", :shape => "none", :label => "", :width => "0", :height => "0.333"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:style => "invis")), Catlab.Graphics.Graphviz.Node("n1", OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:color => "black", :comment => "f", :fillcolor => "white", :id => "n1", :label => Catlab.Graphics.Graphviz.Html("<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\">\n<TR>\n<TD><TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\"><TR><TD HEIGHT=\"24\" WIDTH=\"0\" PORT=\"in1\"></TD></TR></TABLE></TD>\n<TD BORDER=\"1\" CELLPADDING=\"4\">f</TD>\n<TD><TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\"><TR><TD HEIGHT=\"24\" WIDTH=\"0\" PORT=\"out1\"></TD></TR></TABLE></TD>\n</TR>\n</TABLE>"), :style => "solid")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID("n0in1", "e", ""), Catlab.Graphics.Graphviz.NodeID("n1", "in1", "w")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:comment => "A", :id => "e1", :xlabel => "A")), Catlab.Graphics.Graphviz.Edge(Catlab.Graphics.Graphviz.NodeID[Catlab.Graphics.Graphviz.NodeID("n1", "out1", "e"), Catlab.Graphics.Graphviz.NodeID("n0out1", "w", "")], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:comment => "B", :id => "e2", :xlabel => "B"))], OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:fontname => "Serif", :rankdir => "LR"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:fontname => "Courier", :shape => "none", :width => "0", :height => "0", :margin => "0"), OrderedCollections.OrderedDict{Symbol, Union{String, Catlab.Graphics.Graphviz.Html}}(:arrowsize => "0.5", :fontname => "Courier"))
julia> write(f, "diagram.pdf")
ERROR: MethodError: no method matching write(::WiringDiagram{Catlab.Theories.ThBiproductCategory.Meta.T, Any, Any, Any}, ::String)
Closest candidates are:
write(::IO, ::Union{SubString{String}, String})
@ Base strings/io.jl:248
write(::IO, ::AbstractString)
@ Base strings/io.jl:196
write(::IO, ::Any)
@ Base io.jl:687
...
Stacktrace:
[1] top-level scope
@ REPL[14]:1
julia>
julia> write(show_diagram(f), "diagram.pdf")
ERROR: MethodError: no method matching write(::Catlab.Graphics.Graphviz.Graph, ::String)
Closest candidates are:
write(::IO, ::Union{SubString{String}, String})
@ Base strings/io.jl:248
write(::IO, ::AbstractString)
@ Base strings/io.jl:196
write(::IO, ::Any)
@ Base io.jl:687
...
Stacktrace:
[1] top-level scope
@ REPL[15]:1
julia> write(to_wiring_diagram(f), "f_diagram.pdf")
ERROR: MethodError: no method matching to_wiring_diagram(::WiringDiagram{Catlab.Theories.ThBiproductCategory.Meta.T, Any, Any, Any})
Closest candidates are:
to_wiring_diagram(::Type, ::GATExpr, ::Any, ::Any)
@ Catlab ~/.julia/packages/Catlab/bgTXj/src/wiring_diagrams/Expressions.jl:34
to_wiring_diagram(::Type, ::GATExpr)
@ Catlab ~/.julia/packages/Catlab/bgTXj/src/wiring_diagrams/Expressions.jl:31
to_wiring_diagram(::GATExpr, Any...)
@ Catlab ~/.julia/packages/Catlab/bgTXj/src/wiring_diagrams/Expressions.jl:27
Stacktrace:
[1] top-level scope
@ REPL[16]:1
julia> import Convex, SCS
│ Packages [Convex, SCS] not found, but packages named [Convex, SCS] are available from a registry.
│ Install packages?
│ (@v1.10) pkg> add Convex SCS
└ (y/n/o) [y]: y
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
Installed DiffResults ────────── v1.1.0
Installed IrrationalConstants ── v0.2.2
Installed SCS ────────────────── v2.0.0
Installed Bzip2_jll ──────────── v1.0.8+1
Installed DiffRules ──────────── v1.15.1
Installed BenchmarkTools ─────── v1.4.0
Installed SpecialFunctions ───── v2.3.1
Installed NaNMath ────────────── v1.0.2
Installed CodecBzip2 ─────────── v0.8.2
Installed AbstractTrees ──────── v0.4.4
Installed MutableArithmetics ─── v1.4.0
Installed TranscodingStreams ─── v0.10.3
Installed AMD ────────────────── v0.5.3
Installed OpenBLAS32_jll ─────── v0.3.24+0
Installed SCS_jll ────────────── v3.2.4+0
Installed CommonSubexpressions ─ v0.3.0
Installed LogExpFunctions ────── v0.3.26
Installed LDLFactorizations ──── v0.10.1
Installed OpenSpecFun_jll ────── v0.5.5+0
Installed ForwardDiff ────────── v0.10.36
Installed Convex ─────────────── v0.15.4
Installed CodecZlib ──────────── v0.7.4
Installed DocStringExtensions ── v0.9.3
Installed MathOptInterface ───── v1.25.2
Downloaded artifact: Bzip2
Downloaded artifact: OpenBLAS32
Downloaded artifact: SCS
Downloaded artifact: OpenSpecFun
Updating `~/.julia/environments/v1.10/Project.toml`
[f65535da] + Convex v0.15.4
[c946c3f1] + SCS v2.0.0
Updating `~/.julia/environments/v1.10/Manifest.toml`
[14f7f29c] + AMD v0.5.3
[1520ce14] + AbstractTrees v0.4.4
[6e4b80f9] + BenchmarkTools v1.4.0
[523fee87] + CodecBzip2 v0.8.2
[944b1d66] + CodecZlib v0.7.4
[bbf7d656] + CommonSubexpressions v0.3.0
[f65535da] + Convex v0.15.4
[163ba53b] + DiffResults v1.1.0
[b552c78f] + DiffRules v1.15.1
[ffbed154] + DocStringExtensions v0.9.3
[f6369f11] + ForwardDiff v0.10.36
[92d709cd] + IrrationalConstants v0.2.2
[40e66cde] + LDLFactorizations v0.10.1
[2ab3a3ac] + LogExpFunctions v0.3.26
[b8f27783] + MathOptInterface v1.25.2
[d8a4904e] + MutableArithmetics v1.4.0
[77ba4419] + NaNMath v1.0.2
[c946c3f1] + SCS v2.0.0
[276daf66] + SpecialFunctions v2.3.1
[3bb67fe8] + TranscodingStreams v0.10.3
[6e34b625] + Bzip2_jll v1.0.8+1
⌅ [656ef2d0] + OpenBLAS32_jll v0.3.24+0
[efe28fd5] + OpenSpecFun_jll v0.5.5+0
[f4f2fc5b] + SCS_jll v3.2.4+0
[9abbd945] + Profile
[8dfed614] + Test
[05823500] + OpenLibm_jll v0.8.1+2
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated -m`
Precompiling project...
28 dependencies successfully precompiled in 40 seconds. 56 already precompiled.
julia> import TikzPicturesy
ERROR: ArgumentError: Package TikzPicturesy not found in current path.
- Run `import Pkg; Pkg.add("TikzPicturesy")` to install the TikzPicturesy package.
Stacktrace:
[1] macro expansion
@ Base ./loading.jl:1766 [inlined]
[2] macro expansion
@ Base ./lock.jl:267 [inlined]
[3] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1747
[4] #invoke_in_world#3
@ Base ./essentials.jl:921 [inlined]
[5] invoke_in_world
@ Base ./essentials.jl:918 [inlined]
[6] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1740
(@v1.10) pkg> add TikzPictures
Resolving package versions...
Installed Graphite2_jll ───────────── v1.3.14+0
Installed Pixman_jll ──────────────── v0.42.2+0
Installed JpegTurbo_jll ───────────── v3.0.1+0
Installed Libmount_jll ────────────── v2.35.0+0
Installed Gettext_jll ─────────────── v0.21.0+0
Installed TikzPictures ────────────── v3.5.0
Installed Xorg_libXext_jll ────────── v1.3.4+4
Installed LERC_jll ────────────────── v3.0.0+1
Installed Zstd_jll ────────────────── v1.5.5+0
Installed Xorg_xtrans_jll ─────────── v1.5.0+0
Installed OpenSSL_jll ─────────────── v1.1.23+0
Installed Expat_jll ───────────────── v2.5.0+0
Installed OpenJpeg_jll ────────────── v2.4.0+0
Installed Poppler_jll ─────────────── v21.9.0+0
Installed tectonic_jll ────────────── v0.13.1+0
Installed Libgcrypt_jll ───────────── v1.8.7+0
Installed LLVMOpenMP_jll ──────────── v15.0.7+0
Installed HarfBuzz_jll ────────────── v2.8.1+1
Installed HarfBuzz_ICU_jll ────────── v2.8.1+0
Installed LZO_jll ─────────────────── v2.10.1+0
Installed Libtiff_jll ─────────────── v4.4.0+0
Installed ICU_jll ─────────────────── v69.1.0+0
Installed Xorg_libXrender_jll ─────── v0.9.10+4
Installed Libffi_jll ──────────────── v3.2.2+1
Installed Glib_jll ────────────────── v2.76.5+0
Installed Xorg_libpthread_stubs_jll ─ v0.1.1+0
Installed Fontconfig_jll ──────────── v2.13.93+0
Installed FreeType2_jll ───────────── v2.13.1+0
Installed XSLT_jll ────────────────── v1.1.34+0
Installed Libgpg_error_jll ────────── v1.42.0+0
Installed Cairo_jll ───────────────── v1.16.1+1
Installed Xorg_libX11_jll ─────────── v1.8.6+0
Installed Xorg_libXdmcp_jll ───────── v1.1.4+0
Installed LittleCMS_jll ───────────── v2.12.0+0
Installed Xorg_libXau_jll ─────────── v1.0.11+0
Installed libpng_jll ──────────────── v1.6.40+0
Installed Xorg_libxcb_jll ─────────── v1.15.0+0
Installed Libuuid_jll ─────────────── v2.36.0+0
Downloaded artifact: JpegTurbo
Downloaded artifact: Graphite2
Downloaded artifact: Pixman
Downloaded artifact: LERC
Downloaded artifact: Gettext
Downloaded artifact: Zstd
Downloaded artifact: Expat
Downloaded artifact: OpenJpeg
Downloaded artifact: OpenSSL
Downloaded artifact: Poppler
Downloaded artifact: Libgcrypt
Downloaded artifact: tectonic
Downloaded artifact: HarfBuzz
Downloaded artifact: LLVMOpenMP
Downloaded artifact: HarfBuzz_ICU
Downloaded artifact: ICU
Downloaded artifact: Libtiff
Downloaded artifact: LZO
Downloaded artifact: Libffi
Downloaded artifact: Glib
Downloaded artifact: XSLT
Downloaded artifact: Cairo
Downloaded artifact: Fontconfig
Downloaded artifact: Libgpg_error
Downloaded artifact: FreeType2
Downloaded artifact: LittleCMS
Downloaded artifact: libpng
Updating `~/.julia/environments/v1.10/Project.toml`
[37f6aa50] + TikzPictures v3.5.0
Updating `~/.julia/environments/v1.10/Manifest.toml`
[37f6aa50] + TikzPictures v3.5.0
[83423d85] + Cairo_jll v1.16.1+1
[2e619515] + Expat_jll v2.5.0+0
[a3f928ae] + Fontconfig_jll v2.13.93+0
[d7e528f0] + FreeType2_jll v2.13.1+0
[78b55507] + Gettext_jll v0.21.0+0
[7746bdde] + Glib_jll v2.76.5+0
[3b182d85] + Graphite2_jll v1.3.14+0
[655565e8] + HarfBuzz_ICU_jll v2.8.1+0
[2e76f6c2] + HarfBuzz_jll v2.8.1+1
⌅ [a51ab1cf] + ICU_jll v69.1.0+0
[aacddb02] + JpegTurbo_jll v3.0.1+0
[88015f11] + LERC_jll v3.0.0+1
[1d63c593] + LLVMOpenMP_jll v15.0.7+0
[dd4b983a] + LZO_jll v2.10.1+0
⌅ [e9f186c6] + Libffi_jll v3.2.2+1
[d4300ac3] + Libgcrypt_jll v1.8.7+0
[7add5ba3] + Libgpg_error_jll v1.42.0+0
[4b2f31a3] + Libmount_jll v2.35.0+0
⌅ [89763e89] + Libtiff_jll v4.4.0+0
[38a345b3] + Libuuid_jll v2.36.0+0
⌃ [d3a379c0] + LittleCMS_jll v2.12.0+0
⌃ [643b3616] + OpenJpeg_jll v2.4.0+0
⌅ [458c3c95] + OpenSSL_jll v1.1.23+0
[30392449] + Pixman_jll v0.42.2+0
⌅ [9c32591e] + Poppler_jll v21.9.0+0
[aed1982a] + XSLT_jll v1.1.34+0
[4f6342f7] + Xorg_libX11_jll v1.8.6+0
[0c0b7dd1] + Xorg_libXau_jll v1.0.11+0
[a3789734] + Xorg_libXdmcp_jll v1.1.4+0
[1082639a] + Xorg_libXext_jll v1.3.4+4
[ea2f1a96] + Xorg_libXrender_jll v0.9.10+4
[14d82f49] + Xorg_libpthread_stubs_jll v0.1.1+0
[c7cfdc94] + Xorg_libxcb_jll v1.15.0+0
[c5fb5394] + Xorg_xtrans_jll v1.5.0+0
[3161d3a3] + Zstd_jll v1.5.5+0
[b53b4c65] + libpng_jll v1.6.40+0
⌅ [d7dd28d6] + tectonic_jll v0.13.1+0
[efcefdf7] + PCRE2_jll v10.42.0+1
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
Precompiling project...
39 dependencies successfully precompiled in 11 seconds. 85 already precompiled.
(@v1.10) pkg>
flox [default] barton@grothendieck ~ % julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> using Catlab.WiringDiagrams, Catlab.Graphics
julia> import Convex, SCS
julia> import TikzPictures
julia>
julia> using Catlab.Theories
julia> A, B, C, D = Ob(FreeSymmetricMonoidalCategory, :A, :B, :C, :D)
4-element Vector{Catlab.Theories.FreeSymmetricMonoidalCategory.Ob{:generator}}:
A
B
C
D
julia> f, g = Hom(:f, A, B), Hom(:g, B, A);
julia> to_tikz(f)
Catlab.Graphics.TikZ.Document(Catlab.Graphics.TikZ.Picture(Catlab.Graphics.TikZ.Statement[Catlab.Graphics.TikZ.Node("root", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("outer box", nothing), Catlab.Graphics.TikZ.Property("minimum width", "6\\tikzunit"), Catlab.Graphics.TikZ.Property("minimum height", "4\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), ""), Catlab.Graphics.TikZ.Node("n1", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("box", nothing), Catlab.Graphics.TikZ.Property("minimum size", "2\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), "\$f\$"), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("root.west"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "-180")]), Catlab.Graphics.TikZ.NodeCoordinate("n1.west")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", nothing)]), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("n1.east"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "180")]), Catlab.Graphics.TikZ.NodeCoordinate("root.east")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", nothing)])], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("unit length/.code", "{{\\newdimen\\tikzunit}\\setlength{\\tikzunit}{#1}}"), Catlab.Graphics.TikZ.Property("unit length", "4mm"), Catlab.Graphics.TikZ.Property("x", "\\tikzunit"), Catlab.Graphics.TikZ.Property("y", "\\tikzunit"), Catlab.Graphics.TikZ.Property("semithick", nothing), Catlab.Graphics.TikZ.Property("box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("rectangle", nothing), Catlab.Graphics.TikZ.Property("draw", nothing), Catlab.Graphics.TikZ.Property("solid", nothing), Catlab.Graphics.TikZ.Property("rounded corners", nothing)]), Catlab.Graphics.TikZ.Property("outer box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", "none")]), Catlab.Graphics.TikZ.Property("wire/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", nothing)])]), ["calc", "shapes.geometric"], ["amssymb"])
julia> f_diagram = to_tikz(f)
Catlab.Graphics.TikZ.Document(Catlab.Graphics.TikZ.Picture(Catlab.Graphics.TikZ.Statement[Catlab.Graphics.TikZ.Node("root", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("outer box", nothing), Catlab.Graphics.TikZ.Property("minimum width", "6\\tikzunit"), Catlab.Graphics.TikZ.Property("minimum height", "4\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), ""), Catlab.Graphics.TikZ.Node("n1", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("box", nothing), Catlab.Graphics.TikZ.Property("minimum size", "2\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), "\$f\$"), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("root.west"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "-180")]), Catlab.Graphics.TikZ.NodeCoordinate("n1.west")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", nothing)]), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("n1.east"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "180")]), Catlab.Graphics.TikZ.NodeCoordinate("root.east")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", nothing)])], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("unit length/.code", "{{\\newdimen\\tikzunit}\\setlength{\\tikzunit}{#1}}"), Catlab.Graphics.TikZ.Property("unit length", "4mm"), Catlab.Graphics.TikZ.Property("x", "\\tikzunit"), Catlab.Graphics.TikZ.Property("y", "\\tikzunit"), Catlab.Graphics.TikZ.Property("semithick", nothing), Catlab.Graphics.TikZ.Property("box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("rectangle", nothing), Catlab.Graphics.TikZ.Property("draw", nothing), Catlab.Graphics.TikZ.Property("solid", nothing), Catlab.Graphics.TikZ.Property("rounded corners", nothing)]), Catlab.Graphics.TikZ.Property("outer box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", "none")]), Catlab.Graphics.TikZ.Property("wire/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", nothing)])]), ["calc", "shapes.geometric"], ["amssymb"])
julia> write(f_diagram, "f_diagram.pdf")
ERROR: MethodError: no method matching write(::Catlab.Graphics.TikZ.Document, ::String)
Closest candidates are:
write(::IO, ::Union{SubString{String}, String})
@ Base strings/io.jl:248
write(::IO, ::AbstractString)
@ Base strings/io.jl:196
write(::IO, ::Any)
@ Base io.jl:687
...
Stacktrace:
[1] top-level scope
@ REPL[9]:1
julia> Tik
TikZWiringDiagrams
TikzPictures
julia> Tik
TikZWiringDiagrams
TikzPictures
julia> import Catlab.Graphics: TikZ
julia> TikZ.pprint(f_diagram)
\usepackage{amssymb}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.geometric}
\begin{tikzpicture}[unit length/.code={{\newdimen\tikzunit}\setlength{\tikzunit}{#1}},unit length=4mm,x=\tikzunit,y=\tikzunit,semithick,box/.style={rectangle,draw,solid,rounded corners},outer box/.style={draw=none},wire/.style={draw}]
\node[outer box,minimum width=6\tikzunit,minimum height=4\tikzunit] (root) at (0,0) {};
\node[box,minimum size=2\tikzunit] (n1) at (0,0) {$f$};
\path[wire] (root.west) to[out=0,in=-180] (n1.west);
\path[wire] (n1.east) to[out=0,in=180] (root.east);
\end{tikzpicture}
julia> f_diagram = to_tikz(f, labels=true)
Catlab.Graphics.TikZ.Document(Catlab.Graphics.TikZ.Picture(Catlab.Graphics.TikZ.Statement[Catlab.Graphics.TikZ.Node("root", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("outer box", nothing), Catlab.Graphics.TikZ.Property("minimum width", "6\\tikzunit"), Catlab.Graphics.TikZ.Property("minimum height", "4\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), ""), Catlab.Graphics.TikZ.Node("n1", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("box", nothing), Catlab.Graphics.TikZ.Property("minimum size", "2\\tikzunit")], Catlab.Graphics.TikZ.Coordinate("0", "0"), "\$f\$"), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("root.west"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "-180")]), Catlab.Graphics.TikZ.NodeCoordinate("n1.west")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", "{\\node[anchor=south] {\$A\$};}")]), Catlab.Graphics.TikZ.Edge(Catlab.Graphics.TikZ.PathExpression[Catlab.Graphics.TikZ.NodeCoordinate("n1.east"), Catlab.Graphics.TikZ.PathOperation("to", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("out", "0"), Catlab.Graphics.TikZ.Property("in", "180")]), Catlab.Graphics.TikZ.NodeCoordinate("root.east")], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("wire", "{\\node[anchor=south] {\$B\$};}")])], Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("unit length/.code", "{{\\newdimen\\tikzunit}\\setlength{\\tikzunit}{#1}}"), Catlab.Graphics.TikZ.Property("unit length", "4mm"), Catlab.Graphics.TikZ.Property("x", "\\tikzunit"), Catlab.Graphics.TikZ.Property("y", "\\tikzunit"), Catlab.Graphics.TikZ.Property("semithick", nothing), Catlab.Graphics.TikZ.Property("box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("rectangle", nothing), Catlab.Graphics.TikZ.Property("draw", nothing), Catlab.Graphics.TikZ.Property("solid", nothing), Catlab.Graphics.TikZ.Property("rounded corners", nothing)]), Catlab.Graphics.TikZ.Property("outer box/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", "none")]), Catlab.Graphics.TikZ.Property("wire/.style", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("draw", nothing), Catlab.Graphics.TikZ.Property("postaction", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("decorate", nothing)]), Catlab.Graphics.TikZ.Property("decoration", Catlab.Graphics.TikZ.Property[Catlab.Graphics.TikZ.Property("markings", nothing), Catlab.Graphics.TikZ.Property("mark", "at position 0.5 with {#1}")])])]), ["calc", "shapes.geometric", "decorations.markings"], ["amssymb"])
julia> TikZ.pprint(f_diagram)
\usepackage{amssymb}
\usetikzlibrary{calc}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{decorations.markings}
\begin{tikzpicture}[unit length/.code={{\newdimen\tikzunit}\setlength{\tikzunit}{#1}},unit length=4mm,x=\tikzunit,y=\tikzunit,semithick,box/.style={rectangle,draw,solid,rounded corners},outer box/.style={draw=none},wire/.style={draw,postaction={decorate},decoration={markings,mark=at position 0.5 with {#1}}}]
\node[outer box,minimum width=6\tikzunit,minimum height=4\tikzunit] (root) at (0,0) {};
\node[box,minimum size=2\tikzunit] (n1) at (0,0) {$f$};
\path[wire={\node[anchor=south] {$A$};}] (root.west) to[out=0,in=-180] (n1.west);
\path[wire={\node[anchor=south] {$B$};}] (n1.east) to[out=0,in=180] (root.east);
\end{tikzpicture}
julia>
(@v1.10) pkg> LispSyntax
ERROR: `LispSyntax` is not a recognized command. Type ? for help with available commands
(@v1.10) pkg> add LispSyntax
Updating registry at `~/.julia/registries/General.toml`
Resolving package versions...
Installed ReplMaker ──────── v0.2.7
Installed AutoHashEquals ─── v2.1.0
Installed LispSyntax ─────── v0.2.1
Installed ParserCombinator ─ v2.2.1
Updating `~/.julia/environments/v1.10/Project.toml`
[51c06dcf] + LispSyntax v0.2.1
Updating `~/.julia/environments/v1.10/Manifest.toml`
[15f4f7f2] + AutoHashEquals v2.1.0
[51c06dcf] + LispSyntax v0.2.1
[fae87a5f] + ParserCombinator v2.2.1
[b873ce64] + ReplMaker v0.2.7
Precompiling project...
4 dependencies successfully precompiled in 4 seconds. 124 already precompiled.
Created
February 8, 2024 21:52
-
-
Save bmorphism/b0fb19f486d92848662c15da56edb1b6 to your computer and use it in GitHub Desktop.
julia.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment