1
0
mirror of https://gitlab.com/scemama/qp_plugins_scemama.git synced 2024-11-07 22:53:42 +01:00
qp_plugins_scemama/devel/svdwf/QR.py
Abdallah AMMAR 4724e9f6f0 random svd
2021-04-08 16:31:31 +02:00

10 lines
221 B
Python

# !!!
import numpy as np
# !!!
def QR_fact(X):
Q, R = np.linalg.qr(X, mode="reduced")
D = np.diag( np.sign( np.diag(R) ) )
Qunique = np.dot(Q,D)
#Runique = np.dot(D,R)
return(Qunique)
# !!!