Buenas, I'm trying to find the eigenvalues and eigenvectors of a matrix H using the Householder Method. Math::MatrixReal has many functions for this , one of them is sym_diagonalize(). The problem is that I use PDL to define H and when I run the program I get this error " Can't locate object method "sym_diagonalize" via package "PDL" ". Can't I use both modules in the same code or there is a mistake on how Im calling the functions?

use warnings; use strict; use PDL; use Math::MatrixReal; #Parámetros my $epsilon=4.52; my $d0=0.0030; my $Vprim=5; my $Dprim=4; #D/d0 #operadores P y X (NxN=15) my $P=(pdl[[ 0, -sqrt(1),0,0,0,0,0,0,0,0,0,0,0,0,0], [sqrt(1),0, -sqrt(2),0,0,0,0,0,0,0,0,0,0,0,0], [0, sqrt(2),0,-sqrt(3),0,0,0,0,0,0,0,0,0,0,0], [0,0,sqrt(3),0,-sqrt(4),0,0,0,0,0,0,0,0,0,0], [0,0,0,sqrt(4),0,-sqrt(5),0,0,0,0,0,0,0,0,0], [0,0,0,0,sqrt(5),0,-sqrt(6),0,0,0,0,0,0,0,0], [0,0,0,0,0,sqrt(6),0,-sqrt(7),0,0,0,0,0,0,0], [0,0,0,0,0,0,sqrt(7),0,-sqrt(8),0,0,0,0,0,0], [0,0,0,0,0,0,0,sqrt(8),0,-sqrt(9),0,0,0,0,0], [0,0,0,0,0,0,0,0,sqrt(9),0,-sqrt(10),0,0,0,0], [0,0,0,0,0,0,0,0,0,sqrt(10),0,-sqrt(11),0,0,0], [0,0,0,0,0,0,0,0,0,0,sqrt(11),0,-sqrt(12),0,0], [0,0,0,0,0,0,0,0,0,0,0,sqrt(12),0,-sqrt(13),0], [0,0,0,0,0,0,0,0,0,0,0,0,sqrt(13),0,-sqrt(14)], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,sqrt(14)] ]); my $X=(pdl[[0,sqrt(1),0,0,0,0,0,0,0,0,0,0,0,0,0], [sqrt(1),0, sqrt(2),0,0,0,0,0,0,0,0,0,0,0,0], [0, sqrt(2),0,sqrt(3),0,0,0,0,0,0,0,0,0,0,0], [0,0,sqrt(3),0,sqrt(4),0,0,0,0,0,0,0,0,0,0], [0,0,0,sqrt(4),0,sqrt(5),0,0,0,0,0,0,0,0,0], [0,0,0,0,sqrt(5),0,sqrt(6),0,0,0,0,0,0,0,0], [0,0,0,0,0,sqrt(6),0,sqrt(7),0,0,0,0,0,0,0], [0,0,0,0,0,0,sqrt(7),0,sqrt(8),0,0,0,0,0,0], [0,0,0,0,0,0,0,sqrt(8),0,sqrt(9),0,0,0,0,0], [0,0,0,0,0,0,0,0,sqrt(9),0,sqrt(10),0,0,0,0], [0,0,0,0,0,0,0,0,0,sqrt(10),0,sqrt(11),0,0,0], [0,0,0,0,0,0,0,0,0,0,sqrt(11),0,sqrt(12),0,0], [0,0,0,0,0,0,0,0,0,0,0,sqrt(12),0,sqrt(13),0], [0,0,0,0,0,0,0,0,0,0,0,0,sqrt(13),0,sqrt(14)], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,sqrt(14)] ]); # #trucamiento de H my $j=<STDIN>; #cambio la dimensión #parte 1 , selecciono corto columnas my $x1=slice($X,"0:$j:1"); my $p1=slice($P,"0:$j:1"); #parte 2 , selecciono corto filas my $k=0; my @index; while($k<$j+1){ push @index,$k; $k=$k+1; }; #operadores de dimensión $jx$j my $p2=$p1->dice_axis(1,[@index]); my $x2=$x1->dice_axis(1,[@index]); #verificando #print "$p2\n$x2\n"; my $a=$x2 x $x2; my $b= $x2 x $x2 x $x2 x $x2; my $c= $p2 x $p2; #print "$a\n$b\n$c\n"; my $H= -(($c)/4) + 4*($Vprim/($Dprim**4))*($b) - 4*($Vprim/($Dprim**2) +)*($a); my $l; my $v; ($l, $v) = $H->sym_diagonalize();

In reply to PDL & Math::MatrixReal by Lucero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.