~ruther/guix-local

e9b8d0653e1feecefb3c672da5f05ca834db8764 — Mark Walker 1 year, 1 month ago 60828ad
gnu: Add python-pyzx.

* gnu/packages/python-science.scm (python-pyzx): New variable.

Change-Id: I69895a9deb5739db9c0d5e793e3f864c800f4504
Reviewed-by: @lilyp
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
1 files changed, 53 insertions(+), 0 deletions(-)

M gnu/packages/python-science.scm
M gnu/packages/python-science.scm => gnu/packages/python-science.scm +53 -0
@@ 29,6 29,7 @@
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
;;; Copyright © 2024 Rick Huijzer <ikbenrickhuyzer@gmail.com>
;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr>
;;; Copyright © 2025 Mark Walker <mark.damon.walker@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 553,6 554,58 @@ allows arithmetic operations between them and conversions from and to
different units.")
    (license license:bsd-3)))

(define-public python-pyzx
  (package
    (name "python-pyzx")
    (version "0.9.0")
    (source
     (origin
       (method git-fetch)        ; no tests in PyPI
       (uri (git-reference
             (url "https://github.com/zxcalc/pyzx")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
         (base32 "1bnmz08w1bmipir1wnn1k3fw64rply7891xns22qfj6yh0j1n6rj"))))
    (build-system pyproject-build-system)
    (arguments (list #:test-flags
                     #~(list
                        ;; Ignore long running tests
                        "--ignore=tests/long_test.py"
                        "--ignore=tests/long_scalar_test.py")
                     #:phases
                     #~(modify-phases %standard-phases
                         (add-before 'check 'pre-check
                           (lambda* (#:key inputs outputs #:allow-other-keys)
                             (setenv "HOME" "/tmp")
                             ;; Matplotlib needs to be able to write its
                             ;; configuration file somewhere.
                             (setenv "MPLCONFIGDIR" "/tmp"))))))
    (native-inputs (list python-pytest
                         python-setuptools
                         python-wheel))
    (propagated-inputs (list python-ipywidgets
                             python-lark
                             python-numpy
                             python-pyperclip
                             python-tqdm))
    (home-page "https://github.com/zxcalc/pyzx")
    (synopsis "Quantum circuit rewriting and optimisation using the ZX-calculus")
    (description
     "PyZX is a Python tool implementing the theory of ZX-calculus for the
creation, visualisation, and automated rewriting of large-scale quantum
circuits.  PyZX currently allows you to:

@itemize
@item Read in quantum circuits in the file format of QASM, Quipper or Quantomatic;
@item Rewrite circuits into a pseudo-normal form using the ZX-calculus;
@item Extract new simplified circuits from these reduced graphs;
@item Visualise the ZX-graphs and rewrites using either Matplotlib, Quantomatic
or as a TikZ file for use in LaTeX documents;
@item Output the optimised circuits in QASM, QC or QUIPPER format.
@end itemize")
    (license license:asl2.0)))

(define-public python-qdldl
  (package
    (name "python-qdldl")