Skip to content

Conversation

stylewarning
Copy link
Member

@stylewarning stylewarning commented Jun 14, 2022

This commit imports an implementation of CSD from the QUILC project,
written by Juan Bello-Rivas (@jmbr).

It also includes a lot of code for implementing other functions natively in Lisp, written by Erik Davis (@kilimanjaro). These include QR, SVD, etc.

The purpose of this is to provide a regular interface to CSD for use by other packages. We solve this by providing two functions: csd-blocks (which is generic) which provides block-style results to the CSD, and csd which provides ordinary matrices.

Why expose csd-blocks? Both LAPACK, @jmbr, and various papers/documentation express the CSD algorithm in this way. QUILC, moreover, uses the block structure instead of the matrix structure directly. So it seems like a good idea to expose it.

CSD is also exposed, but it just calls CSD-BLOCKS underneath.

The companion PR quil-lang/quilc#828 removes CSD from QUILC.

Still needed:

  • random-unitary needs QR decomposition, so we'll want a Lisp version of that...
  • mult in Lisp
  • LU
  • eig

@stylewarning stylewarning marked this pull request as ready for review June 14, 2022 23:23
@stylewarning stylewarning marked this pull request as draft June 15, 2022 01:59
@stylewarning stylewarning changed the title add MAGICL:CSD-BLOCKS, define MAGICL:CSD on it add MAGICL:CSD-BLOCKS, define MAGICL:CSD on it, and other lisp-native routines Jun 16, 2022
@stylewarning stylewarning force-pushed the csd branch 2 times, most recently from e39861e to b535841 Compare June 21, 2022 20:18
@stylewarning stylewarning marked this pull request as ready for review September 7, 2022 01:22
@stylewarning
Copy link
Member Author

This code doesn't accomplish making MAGICL completely independent of LAPACK, but it moves us closer. All tests pass in MAGICL, and all tests pass in CL-QUIL. So I'm going to merge.

@stylewarning stylewarning merged commit c7730fb into master Sep 7, 2022
@stylewarning stylewarning deleted the csd branch September 7, 2022 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant