On 2013-11-19 at 10:28:51 -0800, MARK BAKER wrote:
> Also a Module for working with Quantum Mechanics would be nice 
>   as my inverse matrices are not producing the right out puts 
> example
> [1,2,3]
> [2,4,5]
> [3,5,6]
> 
> should equal 
> 
> [1,-3,2]
> [-3,3,-1]
> [2,-1,0]
> 
> however in 2.007 it equals 
>  
>  [         1        0.5 0.33333333]
>  [       0.5       0.25        0.2]
>  [0.33333333        0.2 0.16666667]
> 

Hi Mark,

You'll want to use the inv() function:


    my $mat = pdl q/1 2 3; 2 4 5; 3 5 6/;
    print inv($mat); # use inv() for matrix inversion 
<http://pdl.perl.org/PDLdocs/MatrixOps.html#inv>
    print 1 / $mat;  # instead of element-wise operator 
<http://pdl.perl.org/PDLdocs/Ops.html#divide>


Regards,
- Zaki Mughal

> 
> 
> Cheers 
> 
> -Mark 
> ENFINX

> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to