Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Name-Jatin Kumar

Roll No.-710

LEGENDRE POLYNOMIAL:-

clc;clear;
D=[-2,0,0;0,-6,0;0,0,-12]
[c,d]=spec(D)
disp(c,'the eigenvector matrix of D is =')
disp(d,'the eigenvalue matrix of D is =')
h=[D]'// complex conjugate of h
ifh==Dthen
disp('the matrix D is hermitian')
else
disp('the matrix is not hermitian')
end
y1=(c(:,1)')*(c(:,1));
disp(y1,'y1=')
y2=(c(:,1)')*(c(:,2));
disp(y2,'y2=')
y3=(c(:,1)')*(c(:,3));
disp(y2,'y3=')

RESULT(console):-
The eigenvector matrix of D is =

0. 0. 1.

0. 1. 0.

1. 0. 0.

eigenvalue matrix of D is =

- 12. 0. 0.

0. - 6. 0.

0. 0. - 2.

matrix D is hermitian

y1= 1. y2= 0. y3= 0.


BESSEL’s POLYNOMIAL:-
clc;clear;
D=[0,0,0;0,2,0;0,0,6]
[c,d]=spec(D)// to find the eigenvectors and eigenvalues
disp(c,'the eigenvector matrix of D is =')
disp(d,'the eigenvalue matrix of D is =')
h=[D]'// complex conjugate of h
ifh==Dthen
disp(' matrix D is hermitian')
else
disp(' matrix is not hermitian')
end
y1=(c(:,1)')*(c(:,1));
disp(y1,'y1=')
y2=(c(:,1)')*(c(:,2));
disp(y2,'y2=')
y3=(c(:,1)')*(c(:,3));
disp(y2,'y3=')

RESULT(console):-
the eigenvector matrix of D is =

1. 0. 0.

0. 1. 0.

0. 0. 1.

the eigenvalue matrix of D is =

0. 0. 0.

0. 2. 0.

0. 0. 6.

matrix D is hermitian
y1= 1. y2= 0. y3= 0.

LAGUERRE POLYNOMIAL:-
clc;clear;
D=[0,0,0;0,-1,0;0,0,-1]
[c,d]=spec(D)
disp(c,'the eigenvector matrix of D is =')
disp(d,'the eigenvalue matrix of D is =')
h=[D]’
if h==Dthen
disp(' matrix D is hermitian')
else
disp(' matrix is not hermitian')
end
y1=(c(:,1)')*(c(:,1));
disp(y1,'y1=')
y2=(c(:,1)')*(c(:,2));
disp(y2,'y2=')
y3=(c(:,1)')*(c(:,3));
disp(y2,'y3=')

RESULT(console):-
the eigenvector matrix of D is =

0. 0. 1.

1. 0. 0.

0. 1. 0.

the eigenvalue matrix of D is =

- 1. 0. 0.

0. - 1. 0.

0. 0. 0.

matrix D is hermitian

y1= 1. y2= 0. y3= 0.


HERMITE POLYNOMIAL:-
clc;clear;

D=[0,0,-2;0,-2,0;0,0,-4]
[c,d]=spec(D)
disp(c,'the eigenvector matrix of D is =')
disp(d,'the eigenvalue matrix of D is =')
h=[D]'
if h==Dthen
disp(' matrix D is hermitian')
else
disp(' matrix is not hermitian')
end
y1=(c(:,1)')*(c(:,1));
disp(y1,'y1=')
y2=(c(:,1)')*(c(:,2));
disp(y2,'y2=')
y3=(c(:,1)')*(c(:,3));
disp(y2,'y3=')

RESULT(console):-
The eigenvector matrix of D is =

1. 0 0.4472136

0 1. 0

0 0 0.8944272

The eigenvalue matrix of D is =

0 0 0

0 - 2. 0

0 0 - 4.

matrix is not hermitian

y1= 1. y2= 0 . y3= 0 .


To prove that the orthogonal polynomials are eigenfunctions of Hermitian differential operator

D=[0,1,0;0,0,2;0,0,0]

A=[5;-4;1]

b=D*A

disp(b,'the result of operator on polynomial =')

[c,d]=spec(D)

disp(c,'the eigenvector matrix of D is =')

disp(d,'the eigenvalue matrix of D is =')

h=[D]'

ifh==Dthen

disp('the matrix D is hermitian')

else

disp('the matrix is not hermitian')

end

y1=(c(:,1)')*(c(:,1));

disp(y1,'y1=')

y2=(c(:,1)')*(c(:,2));

disp(y2,'y2=')

y3=(c(:,1)')*(c(:,3));

disp(y2,'y3=')

RESULT(console):-
the result of operator on polynomial =

- 4.

2.

0.
the eigenvector matrix of D is =

1. - 1. 1.

0 3.00D-292 - 3.00D-292

0 0 0

the eigenvalue matrix of D is =

0 0 0

0 0 0

0 0 0

the matrix is not hermitian

y1= 1. y2= - 1. y3= - 1.

A MATRIX IS HERMITIAN OR NOT:-


clc,clear
n=input("Enter order of matrix ")
fori=1:1:n
forj=1:1:n
A(i,j)=input("Enter value of a1("+string(i)+","+string(j)+")")
end
end
disp("A = ")
disp(A)

h=[A]'// conjugate transpose


disp("A dagger is ")
disp(h)

ifh==Athen
disp("Hermitian")
else
disp("Not Hermitian ")
end
RESULT(console):-
Enter order of matrix 2

Enter value of a1(1,1)1

Enter value of a1(1,2)2+%i

Enter value of a1(2,1)%i

Enter value of a1(2,2)1

A=

1. 2. + i

i 1.

A dagger is

1. -i

2. - i 1.

Not Hermitian

You might also like