Skip to content

Simple module for computing Smith Normal Form of a numpy array over Z_2

Notifications You must be signed in to change notification settings

sauln/smith-normal-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

smith-normal-form

Simple module for computing Smith Normal Form of a numpy array over Z_2

Usage

import numpy as np
from snf import SmithNormalForm
bm =  np.array([[1, 1, 0, 0, 0, 0, 0],
                [1, 0, 1, 1, 1, 0, 0],
                [0, 1, 1, 0, 0, 1, 0],
                [0, 0, 0, 1, 0, 1, 1],
                [0, 0, 0, 0, 1, 0, 1]])


smithers = SmithNormalForm()
bm_snf = smithers.smithify(bm)

>>> array([[1, 0, 0, 0, 0, 0, 0],
           [0, 1, 0, 0, 0, 0, 0],
           [0, 0, 1, 0, 0, 0, 0],
           [0, 0, 0, 1, 0, 0, 0],
           [0, 0, 0, 0, 0, 0, 0]])

About

Simple module for computing Smith Normal Form of a numpy array over Z_2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages