You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-22Lines changed: 69 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,40 +10,87 @@ Lean is an expressive functional programming language that allows to formalize t
10
10
- Catalogization of numerical methods.
11
11
12
12
In short, mathematics is the ultimate abstraction for numerical computing and Lean can understand mathematics. Hopefully, using Lean will allow us to create really powerful and extensible library for scientific computing.
13
-
14
-
# Documentation
15
13
16
-
Manual:
17
-
-[Scientific Computing in Lean](https://lecopivo.github.io/scientific-computing-lean/)
18
-
19
-
Working in progress book on scientific computing in Lean.
20
14
21
-
Presentations:
22
-
-[Automatic Differentiation in Lean - Lean Together 2024](https://www.youtube.com/watch?v=Kjx5KvB8FL8)(30min)
15
+
## Documentation
23
16
24
-
Overview and motivation behind automatic differentiation in Lean, examples of forward and reverse mode AD.
25
-
-[Scientific Computing in Lean - Lean for Scientists and Engineers 2024](https://umbc.webex.com/umbc/ldr.php?RCID=fdb070fac47f174fcecf60a96960eacc)(2h)
17
+
### Manual
18
+
-[Scientific Computing in Lean](https://lecopivo.github.io/scientific-computing-lean/)
19
+
_A work-in-progress book on scientific computing in Lean._
26
20
27
-
Overview and motivation behind SciLean, working with n-dimensional arrays and symbolic/automatic differentiation.
28
-
29
-
# Installation and running examples/tests
21
+
### Presentations
22
+
-[Automatic Differentiation in Lean – Lean Together 2024 (30min)](https://www.youtube.com/watch?v=Kjx5KvB8FL8)
23
+
Motivation and examples of forward and reverse mode AD in Lean.
30
24
31
-
As we are using Lean programming language, you need Lean's version manager =elan=. Follow its installation [instructions](https://github.com/leanprover/elan#installation).
25
+
-[Scientific Computing in Lean – Lean for Scientists and Engineers 2024 (2h)](https://www.youtube.com/watch?v=X1oEV5SsFJ8)
26
+
Overview of SciLean, n-dimensional arrays, symbolic computation, and automatic differentiation.
32
27
33
-
Getting and building SciLean simply:
34
-
```
28
+
-[Scientific Computing in Lean – Seminar at Cambridge University (09 May 2024)](https://www.youtube.com/watch?v=O12SZqIwYCk)
29
+
Covers optimization through differential equations, basic probabilistic programming, and the Walk on Spheres algorithm.
30
+
31
+
32
+
## Using SciLean
33
+
34
+
### Prerequisites
35
+
36
+
SciLean relies on **OpenBLAS** for accelerating numerical computations.
37
+
You’ll need to have it installed on your system:
38
+
39
+
-**Ubuntu**:
40
+
```bash
41
+
sudo apt-get install libopenblas-dev
42
+
```
43
+
-**macOS**:
44
+
```bash
45
+
brew install openblas
46
+
```
47
+
-**Windows**: Currently not officially supported.
48
+
49
+
50
+
### Building SciLean
51
+
52
+
Clone and build the library with:
53
+
54
+
```bash
35
55
git clone https://github.com/lecopivo/SciLean.git
36
56
cd SciLean
37
57
lake exe cache get
38
58
lake build
39
59
```
40
60
41
-
To run examples:
42
-
```
43
-
lake build HarmonicOscillator && .lake/build/bin/HarmonicOscillator
44
-
lake build WaveEquation && .lake/build/bin/WaveEquation
61
+
62
+
### Setting Up Your Project with SciLean
63
+
64
+
To use `SciLean` in your own Lean project:
65
+
66
+
1. Add a `require` statement for `scilean`.
67
+
2. Set `moreLinkArgs` to point to your OpenBLAS library.
68
+
69
+
Here’s an example `lakefile.lean` for a project named `foo`:
require leanblas from git "https://github.com/lecopivo/SciLean" @ "v4.18.0"
88
+
89
+
@[default_target]
90
+
lean_lib Foo {
91
+
roots := #[`Foo]
92
+
}
45
93
```
46
-
Other examples in =examples= directory do not currently work.
47
94
95
+
> **Note:** If your project uses `mathlib`, ensure compatibility with the `scilean` version. Alternatively, omit the explicit `mathlib` requirement, SciLean brings in a compatible version as a transitive dependency.
48
96
49
-
To get an idea how SciLean works have a look at explanation of the harmonic oscillator [example](https://lecopivo.github.io/scientific-computing-lean/Examples/Harmonic-Oscillator/#Scientific-Computing-in-Lean--Examples--Harmonic-Oscillator).
0 commit comments