Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
SmithDecomposition
  • See Also
    • SmithReduce
    • HermiteDecomposition
    • RowReduce
    • LatticeReduce
    • ExtendedGCD
  • Related Guides
    • Matrix Decompositions
    • See Also
      • SmithReduce
      • HermiteDecomposition
      • RowReduce
      • LatticeReduce
      • ExtendedGCD
    • Related Guides
      • Matrix Decompositions

SmithDecomposition[m]

gives the Smith normal form decomposition of an integer matrix m.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Basic Uses  
Special Matrices  
Applications  
Properties & Relations  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • SmithReduce
    • HermiteDecomposition
    • RowReduce
    • LatticeReduce
    • ExtendedGCD
  • Related Guides
    • Matrix Decompositions
    • See Also
      • SmithReduce
      • HermiteDecomposition
      • RowReduce
      • LatticeReduce
      • ExtendedGCD
    • Related Guides
      • Matrix Decompositions

SmithDecomposition

SmithDecomposition[m]

gives the Smith normal form decomposition of an integer matrix m.

Details

  • The result is given in the form {u,r,v}, where u and v are unimodular matrices, r is a diagonal matrix with each diagonal entry dividing the next one, and u.m.vr.
  • The unimodular matrices u and v are integer matrices with Abs[Det[u]]1, and their inverses are also integer matrices.

Examples

open all close all

Basic Examples  (1)

Decompose m into unimodular matrices u and v and a diagonal matrix r:

The determinants of u and v have absolute value 1:

Each entry on the diagonal of r divides the successor:

Confirm the decomposition:

Scope  (12)

Basic Uses  (8)

Find the Smith decomposition of an integer square matrix:

Format the result:

Smith decomposition of a singular matrix:

The number of nonzero rows in r is equal to the rank of m:

Smith decomposition for a rectangular matrix:

The square matrices u and v bring m into diagonal rectangular form:

Use SmithDecomposition with a rational matrix:

Smith decomposition for a Gaussian integer matrix:

Smith decomposition for a Gaussian rational matrix:

Smith decomposition works only with rational matrices:

The Smith decomposition for a large, integer matrix is computed efficiently:

Special Matrices  (4)

Find the Smith decomposition for sparse matrices:

Smith decompositions of structured matrices:

Smith decomposition of an IdentityMatrix consists of three identity matrices:

Smith decomposition of HilbertMatrix:

Applications  (4)

The Smith decomposition can be used to solve linear equations over the integers. Consider with and as follows:

As m=(TemplateBox[{u}, Inverse].r.TemplateBox[{v}, Inverse]), the equation m.x=(TemplateBox[{u}, Inverse].r.TemplateBox[{v}, Inverse]).x=b implies x=v.TemplateBox[{r}, Inverse].u.b:

Compare with the solution from Solve:

For an invertible , a solution exists if and only if the above process produces an integer result:

The Smith decomposition gives a canonical representation for finitely generated Abelian groups. Consider the quotient group of integer 2‐vectors modulo the relations and . That is to say, consider two points in the plane equivalent if they differ by integer multiples of the vectors and . Compute the Smith decomposition of the matrix whose rows are the :

From it can be seen that the structure of the group is , or simply as is the trivial group:

Hence, every point on the plane is equivalent to one of the nine points . Consider the point . To find the canonical representative of , rotate into the diagonal basis using on the right and compute the modulus with respect to the diagonal entries of :

The point is equivalent to , so it should map to the same canonical representative, and it does:

Thus, every integer point in the plane can be reduced to a canonical representative. Conversely, the matrix TemplateBox[{v}, Inverse] can be viewed as mapping the canonical basis to the starting basis. As the lattice generated by and is simply the set of all points equivalent to the origin, rotating that lattice by TemplateBox[{v}, Inverse] will produce the same lattice as generated by and :

Use SmithDecomposition to compute the extended GCD of two integers and :

Let be the column matrix with entries and :

The Smith decomposition gives , with the unique positive , unimodular matrix:

Hence First[u].mFirst[r]:

But as the first row of is the and the left-hand side of the equation is , the foregoing equation is Bézout's identity. This means the extended GCD is:

Compare to ExtendedGCD:

Use SmithDecomposition to compute the right-extended GCDs of two matrices and :

Let be the matrix formed from the rows of and :

The matrix in the Smith decomposition will be a matrix:

Let and be the top-left and top-right quarters of :

The matrix and thus the matrix r.TemplateBox[{v}, Inverse] are, like , matrices:

Let denote the top half of r.TemplateBox[{v}, Inverse]:

The matrices m_a=a.TemplateBox[{g}, Inverse] and m_b=b.TemplateBox[{g}, Inverse] have integer entries:

Hence is a right divisor of both and :

Since the determinants of , , and obey gcd(TemplateBox[{a}, Det],TemplateBox[{b}, Det])=TemplateBox[{g}, Det], is in fact a right GCD:

Moreover, the first three rows of the Smith decomposition give Bézout's identity :

Hence, the extended right GCD is as follows:

Properties & Relations  (10)

The matrix in the decomposition is a square matrix, where is the number of rows of :

The matrix in the decomposition is a square matrix, where is the number of columns of :

The matrix in the decomposition is a diagonal, rectangular matrix of the same dimensions as :

The matrices and each have determinants of magnitude 1:

The and matrices always have integer values, irrespective of whether the input is integer or rational:

This extends to the real and imaginary parts of the result if the input matrix is complex:

Each diagonal entry in divides its successor:

The matrix has integer values if the input matrix is integer:

If the input matrix has noninteger rational elements, so will the matrix:

For a real-valued input, the diagonal entries of the matrix are non-negative:

For complex-valued input, the real and imaginary parts of the entries are non-negative:

The Smith decomposition can often be found by two iterations of the Hermite decomposition:

The first use of HermiteDecomposition gives and an upper-triangular matrix:

Applying HermiteDecomposition to the Transpose of the triangle matrix gives and :

The middle matrix in the Smith decomposition is the Smith normal form given by SmithReduce:

See Also

SmithReduce  HermiteDecomposition  RowReduce  LatticeReduce  ExtendedGCD

Function Repository: PolynomialSmithDecomposition

Related Guides

    ▪
  • Matrix Decompositions

History

Introduced in 2015 (10.2)

Wolfram Research (2015), SmithDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/SmithDecomposition.html.

Text

Wolfram Research (2015), SmithDecomposition, Wolfram Language function, https://reference.wolfram.com/language/ref/SmithDecomposition.html.

CMS

Wolfram Language. 2015. "SmithDecomposition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SmithDecomposition.html.

APA

Wolfram Language. (2015). SmithDecomposition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SmithDecomposition.html

BibTeX

@misc{reference.wolfram_2025_smithdecomposition, author="Wolfram Research", title="{SmithDecomposition}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/SmithDecomposition.html}", note=[Accessed: 01-March-2026]}

BibLaTeX

@online{reference.wolfram_2025_smithdecomposition, organization={Wolfram Research}, title={SmithDecomposition}, year={2015}, url={https://reference.wolfram.com/language/ref/SmithDecomposition.html}, note=[Accessed: 01-March-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English