google / TensorNetwork

A library for easy and efficient manipulation of tensor networks.
Apache License 2.0
1.8k stars 355 forks source link

Add Cholesky decomposition #852

Open alewis opened 3 years ago

alewis commented 3 years ago

We should support the Cholesky decomposition per https://numpy.org/doc/stable/reference/generated/numpy.linalg.cholesky.html#numpy.linalg.cholesky, adding a pivot argument in the same way as qr and svd.

Dbhasin1 commented 3 years ago

Hello, can this issue be assigned to me?

mganahl commented 3 years ago

Sure thing!

alewis commented 3 years ago

Hi @Dbhasin1,

The function and tests first need to be added to the various backends, which live in tensornetwork/backends/blah. The first is the AbstractBackend, a base class that just throws NotImplementedError. The others all wrap functions from other numerical packages, the idea being to provide a means to quickly switch between these.

Inside the backend files you will see many other functions, such as qr. Our QR differs from e.g. NumPy's by the presence of a pivot argument that matricizes the input. Cholesky should have a similar mechanism.

Once added to the backends, the function should also be added to the tn.Tensor interface, which lives in tensornetwork/tensor.py with functions defined in tensornetwork/linalg/blah

LuiGiovanni commented 3 years ago

Hello there @alewis I'm interested in working on this issue has a PR been done? If not I would like to work on this.

LuiGiovanni commented 3 years ago

Hello, please ignore this PR I made a mistake, the changes implemented for the Cholesky decomposition will be from a different PR.

LuiGiovanni commented 3 years ago

Hello, I am sorry for the mess but #886 is the correct PR I was working on disregard #885 thank you.

LuiGiovanni commented 3 years ago

@alewis @mganahl I have added the NotImplementedError function and it's respective test and made a PR for you to review.

alewis commented 3 years ago

Looks good! Just a small fix.

LuiGiovanni commented 3 years ago

@alewis Alright I have made the fix, just waiting on the testing. Also, I will start implementing the Cholesky decomposition, quick question, why does Jax not have it's own decompositions file? Oh, could you add me as an assignee for this issue? Thank you

mganahl commented 3 years ago

it uses the numpy decompositions.py file

LuiGiovanni commented 3 years ago

Ok, I see, then I will start adding the function to that file and work my way from there, thank you!

themnvrao76 commented 3 years ago

hey is this still open? can I work on this?

prat1999 commented 3 years ago

Is this issue still open? Can I work on it?

dhivyasreedhar commented 3 years ago

Hi, can I work on this? I'm new so can someone guide me?

priorigratia commented 3 years ago

Can I work on this issue?

ankitasankars commented 3 years ago

Hello, Can I use this issue as my first contribution? I'm new so please can someone guide me?

mganahl commented 3 years ago

@prat1999 already opened a PR on this (maybe you guys can work together on this)