Here finally my rec.2020 to xyz d50
rgb d65 to xyz d65
[[6.36958048e-01 1.44616904e-01 1.68880975e-01]
[2.62700212e-01 6.77998072e-01 5.93017165e-02]
[4.99410657e-17 2.80726930e-02 1.06098506e+00]]xyz d65 to rgb d65
[[ 1.71665119 -0.35567078 -0.25336628]
[-0.66668435 1.61648124 0.01576855]
[ 0.01763986 -0.04277061 0.94210312]]rgb d65 to xyz d50
[[ 0.67012458 0.16035917 0.09262633]
[ 0.29474229 0.67845094 0.01987506]
[-0.00896833 0.0437666 0.79752177]]
They are different from the rawtherapee matrices but I’m confident that my code is correct because I could match the d65 matrices here
https://colour.readthedocs.io/en/feature-read_the_docs/colour.models.dataset.rec_2020.html
Rawtherapee has matrices more close to this online calculator
http://www.russellcottrell.com/photo/matrixCalculator.htm