The Julia documentation is your go to resource. There are also Learning Resources available.
Jane Herriman gave a great introduction to Julia on youtube. It is 2hr 24min and the tutorial materials are on github.
To install Julia, please follow the directions on the Julia Downloads page. Make sure to install the current stable release v1.7.3. No other versions of julia will be supported in this class.
To install Graphviz, you can use the system package manager such as sudo apt install graphviz
(Debian based Linux) or brew install graphviz
(MacOS). Or these instructions on Windows.
At this point you can install IJulia
as above. Start a julia session and run using Pkg; Pkg.add("IJulia");
.
Now that you have the Julia environment installed, we can install Catlab. You can access the julia package manager using two interfaces.
- The library access:
using Pkg; Pkg.add("Catlab")
- The
]
REPL mode:] add Catlab
Note on Pkg.add
vs Pkg.dev
in order to edit the source code of a library, you have to install that library in developement mode. This will clone the repository of the software and check out the primary developement branch.
- Library access:
using Pkg; Pkg.develop("Catlab")
- Pkg-REPL mode:
]dev Catlab
Now we can load up the Catlab library and start using it. The julia keyword using
loads a module into the current namespace. When working in a notebook or REPL session, the current namespace is called Main
. The following Catlab modules will be helpful for working with ACT concepts up to Ch 2 of our textbook.
using Catlab
using Catlab.Theories # The Categorical Logic core of Catlab
using Catlab.CategoricalAlgebra # Data Structures like FreeDiagrams
using Catlab.Graphics # Generic Drawing APIs
using Catlab.WiringDiagrams # Section 2.2
Then you can start creating data structures and running functions on them.
@present P(FreeSchema) begin
(A,B,C,D)::Ob
ab::Hom(A,B)
ac::Hom(A,C)
cd::Hom(C,D)
bd::Hom(B,D)
end
d = FreeDiagram(P)
to_graphviz(d)
Practice running Catlab code using the examples prepared for this class from the Catlab Documentation. The raw julia files are in the repository and there are rendered html versions in the Catlab docs
-
Run the Partitions Sketch and perform some additional computations on partitions. For example create a partition from an exercise in the textbook and define a refinement. Show that refinements compose using the
compose
function in Catlab. -
Run the Meets/Joins Sketch and do the exercises listed there.