linalgkit-lab2
A clean, well-tested Python library for verifying fundamental linear-algebra properties — vector-space axioms, subspace conditions, basis extraction, norms, dimension, and the rank–nullity theorem.
Installation
pip install linalgkit-lab2
Quick Start
from linalgkit_lab2 import (
check_vector_space,
check_matrix_space,
check_subspace,
find_basis,
find_norm,
find_dimension,
verify_rank_nullity,
print_results,
)
# --- Vector space ---
result = check_vector_space([1, 2], [3, 4], a=2, b=3, zero_vector=[0, 0])
print_results("Vector Space", result)
# --- Matrix space ---
result = check_matrix_space([[1,2],[3,4]], [[5,6],[7,8]], a=2, b=3,
zero_matrix=[[0,0],[0,0]])
print_results("Matrix Space", result)
# --- Subspace ---
result = check_subspace([1, 2], [3, 4], a=2, b=3, zero_vector=[0, 0])
print_results("Subspace", result)
# --- Basis ---
basis = find_basis([[1,0,0],[0,1,0],[1,1,0]])
print("Basis:\n", basis)
# --- Norm ---
print("Norm:", find_norm([3, 4])) # → 5.0
# --- Dimension ---
print("Dim:", find_dimension([[1,0],[0,1],[1,1]])) # → 2
# --- Rank-nullity ---
print(verify_rank_nullity([[1,2,3],[4,5,6]]))
API Reference
check_vector_space(v1, v2, a, b, zero_vector) → dict
Returns a dict mapping each of the 10 standard vector-space axioms to
True / False.
check_matrix_space(A, B, a, b, zero_matrix) → dict
Same as above but for 2-D matrices.
check_subspace(v1, v2, a, b, zero_vector) → dict
Checks the 3 subspace conditions plus an "Is Subspace" verdict key.
| Key | What is checked |
|---|---|
"Contains zero vector" |
zero_vector is all-zeros and acts as additive identity |
"Closed under addition" |
v1 + v2 has correct shape, no NaN/Inf |
"Closed under scalar multiplication" |
a*v1, b*v2 have correct shape, no NaN/Inf |
"Is Subspace" |
All three above pass |
find_basis(vectors) → ndarray
Greedy basis extraction. vectors is a 2-D array whose rows are vectors.
find_norm(vector) → float
Euclidean (L2) norm of a 1-D vector.
find_dimension(vectors) → int
Dimension of the span of the given row vectors (= matrix rank).
verify_rank_nullity(matrix) → dict
Returns {"rank", "nullity", "n_columns", "theorem_holds"}.
print_results(label, results)
Pretty-prints any result dict from the functions above.
Error Handling
All functions raise:
TypeError— non-numeric inputs or non-real scalarsValueError— wrong dimensionality, empty inputs, shape mismatches, NaN/Inf values
License
MIT © manohar100323
Metadata
Release files for linalgkit-lab2 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| linalgkit_lab2-1.0.0.tar.gz | 8.9 kB | Without provenance | Details for linalgkit_lab2-1.0.0.tar.gz |
Release files / linalgkit_lab2-1.0.0.tar.gz
| Download URL | linalgkit_lab2-1.0.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02d44cb14c17702e458d02f0305e74040c9766c0160ac2ada627c448b0599460
|
|
BLAKE2b-256 checksum How to use checksums |
ad010f8bff63dbd081eae6354a2ee4a59b35b3af83f7a361aaa297077bc6de6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Security for linalgkit-lab2 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.