Python scripts for NUS MA1522 Linear Algebra for Computing
Project description
linear-algebra
About
This project builds on SymPy's Matrix class and is designed for students taking NUS MA1522 Linear Algebra for Computing. It has implementations of most of the algorithms taught during the course (as of Sem 1 AY24/25). Documentation of the code is still a work in progress.
Key Features
- Import matrices from LaTeX directly. LaTeX expression can be obtained from Canvas by right-clicking on the equations.
- Step-by-step workings for most algorithms (including LU Factorisation and SVD)
Installation and Usage
Installation
Prerequisites
This project is best supported in a Jupyter Notebook environment with Python 3.10+. You can download Python from here.
Install Dependencies
It is recommended to use a virtual environment for managing dependencies.
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install the library:
pip install ma1522-linear-algebra
It is recommended to use a Jupyter Notebook environment to run the code.
pip install notebook
Usage
Create a Jupyter Notebook test.ipynb. Within the notebook, run the following code.
from symbolic import *
# Create Matrix objects
A = Matrix([[1, 2, 3],
[4, 5, 5],
[7, 8, 9]])
b = Matrix([[1],
[2],
[3]])
# Join matrices along the columns via `row_join`.
augmented_matrix = A.aug_line().row_join(b)
# `aug_line` adds a visual line that can be seen using `display`
display(augmented_matrix)
# Solution to the matrix equation Ax = b can be found using `solve`.
A.solve(rhs=b)
# Alternatively, the full steps with LU Factorisation can be found using `ref` with the appropriate options.
augmented_matrix.ref(verbosity=2)
Documentation of more functions can be found here.
More usage examples can be found under the examples folder. Proper documentation would be coming soon for all functions found in symbolic.py.
FAQ
Development
Work in Progress
- Include better documentations for how to use the functions.
- Better
refalgorithm to determine boundary conditions for a given matrix.
Credits
I would like to thank @DenseLance for his contributions.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ma1522_linear_algebra-0.3.0.tar.gz.
File metadata
- Download URL: ma1522_linear_algebra-0.3.0.tar.gz
- Upload date:
- Size: 38.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e55cb602cfcf51a5ce5043bcfa66458fac2777cfc355c0b666d8d38ff45c913b
|
|
| MD5 |
cc370e776b903cd62d8a0d83227553fe
|
|
| BLAKE2b-256 |
78ce90bbb0369cbce184ef2501ed1c73ae8e73cac69db8064bc5dd8e323f692c
|
Provenance
The following attestation bundles were made for ma1522_linear_algebra-0.3.0.tar.gz:
Publisher:
release.yml on YeeShin504/linear-algebra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ma1522_linear_algebra-0.3.0.tar.gz -
Subject digest:
e55cb602cfcf51a5ce5043bcfa66458fac2777cfc355c0b666d8d38ff45c913b - Sigstore transparency entry: 339756800
- Sigstore integration time:
-
Permalink:
YeeShin504/linear-algebra@58de93acda6fb0c155f7558a789474e80e97139d -
Branch / Tag:
refs/tags/v0.3.1-alpha - Owner: https://github.com/YeeShin504
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58de93acda6fb0c155f7558a789474e80e97139d -
Trigger Event:
release
-
Statement type:
File details
Details for the file ma1522_linear_algebra-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ma1522_linear_algebra-0.3.0-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea8c50ec1300d574f6a918e06544a0fa8fd9830b0a2db1d54f293174630adeac
|
|
| MD5 |
73b74bdf33b8730bbde69de6a9b22736
|
|
| BLAKE2b-256 |
af091c27b20fc3380f6330836c2c86662a4bc840999eb71717de74e1d1cb1fff
|
Provenance
The following attestation bundles were made for ma1522_linear_algebra-0.3.0-py3-none-any.whl:
Publisher:
release.yml on YeeShin504/linear-algebra
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ma1522_linear_algebra-0.3.0-py3-none-any.whl -
Subject digest:
ea8c50ec1300d574f6a918e06544a0fa8fd9830b0a2db1d54f293174630adeac - Sigstore transparency entry: 339756829
- Sigstore integration time:
-
Permalink:
YeeShin504/linear-algebra@58de93acda6fb0c155f7558a789474e80e97139d -
Branch / Tag:
refs/tags/v0.3.1-alpha - Owner: https://github.com/YeeShin504
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@58de93acda6fb0c155f7558a789474e80e97139d -
Trigger Event:
release
-
Statement type: