Skip to main content

choldate

Somewhat fast updating and downdating of Cholesky factors in Python

##installation

Clone the GitHub repository and install from source, e.g.,

  1. git clone git://github.com/jcrudy/choldate.git
  2. cd choldate && make sync && make install-pre-commit && make

The Makefile makes it easy to perform the most common operations:

  • make check-all runs linting and uv.lock checks
  • make check-lint checks for linting issues
  • make check-lock verifies the uv.lock is aligned to pyproject.toml
  • make clean cleans the virtual environment and caches
  • make default runs a default set of checks on the code
  • make fix-all formats the code, fixes lint errors and runs locks uv.lock to pyproject.toml
  • make fix-format formats the code
  • make fix-lint fixes linting issues
  • make fix-lint-unsafe fixes linting issues potentially adding inadvertant bugs
  • make help outputs the different make options
  • make install build install the distribution
  • make install-pre-commit installs pre-commit hooks
  • make lock locks uv.lock to pyproject.toml
  • make install-pre-commit installs pre-commit hooks
  • make run-tests runs the unit tests
  • make sync syncs the python environment with uv.lock

.vscode/settings.json is set so that unit tests can be run without further configuration.

##usage

from choldate import cholupdate, choldowndate
import numpy

#Create a random positive definite matrix, V
numpy.random.seed(1)
X = numpy.random.normal(size=(100,10))
V = numpy.dot(X.transpose(),X)

#Calculate the upper Cholesky factor, R
R = numpy.linalg.cholesky(V).transpose()

#Create a random update vector, u
u = numpy.random.normal(size=R.shape[0])

#Calculate the updated positive definite matrix, V1, and its Cholesky factor, R1
V1 = V + numpy.outer(u,u)
R1 = numpy.linalg.cholesky(V1).transpose()

#The following is equivalent to the above
R1_ = R.copy()
cholupdate(R1_,u.copy())
assert(numpy.all((R1 - R1_)**2 < 1e-16))

#And downdating is the inverse of updating
R_ = R1.copy()
choldowndate(R_,u.copy())
assert(numpy.all((R - R_)**2 < 1e-16))

Important Note

This modules was originally developed by modusdatascience and the original repo can be found at https://github.com/modusdatascience/choldate

This fork is being maintained by jamieleecho.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for jlc-choldate 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jlc-choldate 0.4
File Size Uploaded
jlc_choldate-0.4.tar.gz 70.0 kB Details

Release files / jlc_choldate-0.4.tar.gz

Download URL jlc_choldate-0.4.tar.gz
Size 70.0 kB
Tags Source
SHA-256 checksum
How to use checksums
89608af446ac65aa4f8a07b0246eed1866f35dcfac9447981e48a82ae8f9bd8f
BLAKE2b-256 checksum
How to use checksums
b65563599387e9b94d472c2765381c43fddf762678bd78b0496c609271e52712
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 2, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file

0.3

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page