File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3939/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
4040pub fn random_unitary < A > ( n : usize ) -> Array2 < A >
4141where
42- A : Scalar + RandNormal ,
42+ A : Scalar + Lapack ,
43+ Standard : Distribution < A > ,
4344{
4445 let a: Array2 < A > = random ( ( n, n) ) ;
4546 let ( q, _r) = a. qr_into ( ) . unwrap ( ) ;
@@ -51,12 +52,13 @@ where
5152/// Be sure that this it **NOT** a uniform distribution. Use it only for test purpose.
5253pub fn random_regular < A > ( n : usize ) -> Array2 < A >
5354where
54- A : Scalar + RandNormal ,
55+ A : Scalar + Lapack ,
56+ Standard : Distribution < A > ,
5557{
5658 let a: Array2 < A > = random ( ( n, n) ) ;
5759 let ( q, mut r) = a. qr_into ( ) . unwrap ( ) ;
5860 for i in 0 ..n {
59- r[ ( i, i) ] = A :: from_f64 ( 1.0 ) + AssociatedReal :: inject ( r[ ( i, i) ] . abs ( ) ) ;
61+ r[ ( i, i) ] = A :: one ( ) + A :: from_real ( r[ ( i, i) ] . abs ( ) ) ;
6062 }
6163 q. dot ( & r)
6264}
You can’t perform that action at this time.
0 commit comments