GSoC 2014 Application Rrubaa Panchendrarajan: Implementing Linear Transformation

RubaP edited this page Mar 20, 2014 · 16 revisions


Implement all the functionalities related to linear transformation.

Personal Information

Name: Rrubaa Panchendrarajan
University: Universiy of Moratuwa
GitHub username: RubaP

I am a Computer Science and Engineering undergraduate from University of Moratuwa. Now I am in the end of my 2nd year.

As a programmer

I have more than 2 years of experience in programming especially in Java. I have a basic knowledge in Python. Only place where I used python was for the module called Object Oriented programming in my University. I am using PyCharm as my editor.

As I am a student from department of Computer Science and Engineering, I have good enough knowledge to learn new languages and technologies and solve problems. Feature that I admired in python is declaring variables without specifying its types. It will be easy for a programmer to implement the code quickly. But there are some other problems such as understanding the code. The person who is not implemented the code and go through it will feel hard to understand.

Best feature that I like in sympy is the symbolic expression. Finding the final value of an expression will not always be a need. Sometimes we may need only the way of solving. Symbolic expression will be a solution for that. For example:

>>> from sympy import MatMul, MatrixSymbol
>>> A = MatrixSymbol('A', 5, 4)
>>> B = MatrixSymbol('B', 4, 3)
>>> C = MatrixSymbol('C', 3, 6)
>>> MatMul(A, B, C)

Note: But I am suggesting improving this feature further more as it is not giving complete information

I have used Git as a version control system in so many projects for modules in my University. We were taught Git while we were entering to our department.

My Project

I am planning to implement all the functionalities of Linear Algebra. I am very much interested in mathematics and problem solving. Also I have enough knowledge in python. Mathematics and python, these two reasons were induced me to select sympy. I followed a module called Linear Algebra in semester four in my University. In that module I covered the sections such as vector space, linear transformations, inner product and so many other concepts. So once I saw the topic “Linear Algebra” I would like to go through the already available features.

While going through the implementation I got to know that only “rotation of a matrix” is implemented. So I planned to work in this area which is very much interesting to work.

Contribution to sympy

Currently I am working with the issue .
>>> A = MatrixSymbol('A', 3, 3)
>>> Determinant(A)

Here the determinant of a matrix print itself. I as realized that no point in having a functionality like this, I am suggesting to result the process of finding the determinant of a nxn matrix. Following result is I am expecting to get for any nxn matrix from my implementation.

B[0][0]*B[1][1] - B[1][0]*B[0][1]

pull request :


Defining a transformation
Linear transformation is a function that maps a vector space V into vector space W.


Domain and codomain of T
V is called the domain of T and W is called the codomain of V.


Image and preimage
w is called the image of v under the transformation T. The set of all images of vectors in V is called the range of T and the set of all v in V such that T(v)=w is called the preimage of w.


Supporting the property
The function is called a linear transformation of V into W if the following two properties are true for all v and u in V and for any scalar c.


Linear Transformation defined by a matrix
Let A be a mxn matrix. The function T is defined by T(V)=AV is a linear transformation from Rn into Rm.

>> w=T.transform(v)

Transformation from matrix to matrix


Differential operator as linear transformation
E.g. T: f --> f’ +2f
T(x2+5x) = 2x2+12x+5

Integration as linear transformation
E.g. T(p)= integration of p(x) from -1 to 1

Kernel of linear transformation
Let T: V --> W be a linear transformation. Then the set of all vectors v in V that satisfy T(v)=0 is called the kernel of and is denoted by ker(T)


Range of linear transformation
Range of T: V  W is the set of all vectors w in W that are images of vectors in V. That is range (T)={T(v) : v is in V}

Finding the basis for kernel, range

Finding the dimension
nullity(T) : dimension of kernel of T
rank(T) : dimension of range of T
dimension of the domain : rank + nullity

>>A= Matrix([[1,0,-2],[0,1,1],[0,0,0]])

Finding the standard matrix for a linear Transformation


Composition of linear transformation
The composition of T, of T1 : Rn --> Rm with T2 : Rm --> Rk is defined by,
T(v) = T2(T1(v))



Standard matrix for composition
Standard matrix for composition will be the multiplication of standard matrix of each


>> A2=T2.transformMatrix()

Inverse of a linear transformation
If the standard matrix A of a linear transformation T has inverse then T is also invertible


Finding matrix relative to nonstandard basis
Defining a nonstandard basis for a vector space and Finding the transformation matrix.

>>B1= Basis((1,0),(0,1)))

Transition Matrix
Matrix for a linear transformation T: V  V depends on the basis of V. The matrix for T relative to a basis B is different from the matrix for T relative to another basis B’.
Transition matrix from B to B’: P
Transition matrix from B’ to B: P-1


Similar matrix
For square matrices A and A’ of order n, A’ is said to be similar to A if there exists an invertible matrix P such that A’ = P-1AP



Before starting the project
Learn advanced features of python
Understand code of sympy
Practicing Git
Updating the schedule

Week 1 & 2
Implementing basic classes such Vector Spaces, Transformation and Bases Testing in implemented classes

Week 3
Implementing additional properties of transformation

Week 4
Transformation using matrix and Matrix to Matrix transformation

Week 5 & 6
Implementing available transformations such as Integration and Differentiation

Week 7
Testing all the implemented functions

Week 8
Implementing kernel, image and dimensions

Week 9
Finding Basis

Week 10
Finding standard matrix

Week 11
Composition in transformation and finding standard matrix for composition

Week 12
Inverse of a transition and finding matrix for non-standard basis

Week 13
Finding transition matrix and similar matrix

Week 14
Testing and final modifications


Elementary linear Algebra 6th Edition by Ron Larson
Chapter 6: Linear Transformations

Clone this wiki locally
You can’t perform that action at this time.
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.
Press h to open a hovercard with more details.