JuliaGiac

The Giac computer algebra system, from its C++ sources to Julia.

Get started with Giac.jl GitHub

JuliaGiac brings Giac, the computer algebra system by Bernard Parisse and Renée De Graeve, to Julia: exact symbolic algebra, calculus, equation solving and linear algebra, with more than 2,000 Giac commands, conversions to Symbolics.jl, SymPy.jl, MathJSON.jl and Nemo.jl, and typeset output in notebooks.

using Pkg; Pkg.add("Giac")

Exact results, from Julia

using Giac
using Giac.Commands: factor, integrate, solve
@giac_var x

factor(x^4 - 1)            # (x-1)*(x+1)*(x^2+1)
integrate(1/(1+x^2), x)    # atan(x)
solve(x^2 - 2 ~ 0, x)      # list[-sqrt(2),sqrt(2)]
integrate(exp(-x^2), x, -Inf, Inf)   # sqrt(pi)

From C++ to Julia

Each layer builds on the one below it. Users install the top of the stack; Julia's package manager brings the rest.

  1. GiacSlate.jl Integration with KaimonSlate KaimonSlate
  2. Giac.jl The Julia package Julia
  3. libgiac-julia-wrapper C++ bridge to Julia (libgiac_julia_jll) CxxWrap.jl
  4. GIAC_jll Pre-built libgiac binaries BinaryBuilder
  5. JuliaGiac/giac Giac sources with a Meson build Meson
  6. Giac / Xcas Upstream computer algebra system C++

The layers

1 · C++

Giac / Xcas

Upstream computer algebra system

Free computer algebra system by Bernard Parisse and Renée De Graeve, Institut Fourier (CNRS UMR 5582), Université Grenoble Alpes. Giac is the C++ kernel; Xcas is its interface. GPL-3.0, with a commercial dual license available on request. Everything below builds on this work.

2 · Meson

JuliaGiac/giac

Giac sources with a Meson build

The upstream sources with a Meson build on the dev branch, so that BinaryBuilder can cross-compile libgiac for every platform Julia supports. The Meson build is AI-generated. Fixes found here are proposed upstream.

3 · BinaryBuilder

GIAC_jll

Pre-built libgiac binaries

libgiac compiled for every Julia platform by BinaryBuilder, from the JuliaGiac/giac sources, and installed automatically by Julia's package manager.

4 · CxxWrap.jl

libgiac-julia-wrapper

C++ bridge to Julia (libgiac_julia_jll)

A C++ library that exposes Giac to Julia through CxxWrap.jl: evaluation, per-context state, direct function dispatch and typed access to Giac values. Distributed as libgiac_julia_jll, built against GIAC_jll.

5 · Julia

Giac.jl

The Julia package

Symbolic computation in Julia with Giac: symbolic expressions and variables, the full Giac command set, and conversions to and from Symbolics.jl, SymPy.jl, MathJSON.jl and Nemo.jl.

6 · KaimonSlate

GiacSlate.jl

Integration with KaimonSlate

Integrates Giac.jl with KaimonSlate.

Related