| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 |
|
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 |
|
| 28 | (define-module (gnu packages quantum)
|
| 29 | #:use-module (gnu packages)
|
| 30 | #:use-module (gnu packages check)
|
| 31 | #:use-module (gnu packages lisp-check)
|
| 32 | #:use-module (gnu packages lisp-xyz)
|
| 33 | #:use-module (gnu packages machine-learning)
|
| 34 | #:use-module (gnu packages protobuf)
|
| 35 | #:use-module (gnu packages python-build)
|
| 36 | #:use-module (gnu packages python-check)
|
| 37 | #:use-module (gnu packages python-science)
|
| 38 | #:use-module (gnu packages python-web)
|
| 39 | #:use-module (gnu packages python-xyz)
|
| 40 | #:use-module (guix build-system asdf)
|
| 41 | #:use-module (guix build-system pyproject)
|
| 42 | #:use-module (guix gexp)
|
| 43 | #:use-module (guix git-download)
|
| 44 | #:use-module ((guix licenses) #:prefix license:)
|
| 45 | #:use-module (guix packages))
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 | (define %cirq-version "1.7.0")
|
| 50 |
|
| 51 | (define %cirq-home-page "https://quantumai.google/cirq")
|
| 52 |
|
| 53 | (define %cirq-license license:asl2.0)
|
| 54 |
|
| 55 | |
| 56 | |
| 57 | (define %cirq-source
|
| 58 | (origin
|
| 59 | (method git-fetch)
|
| 60 | (uri (git-reference
|
| 61 | (url "https://github.com/quantumlib/Cirq")
|
| 62 | (commit (string-append "v" %cirq-version))))
|
| 63 | (file-name (git-file-name "python-cirq" %cirq-version))
|
| 64 | (sha256
|
| 65 | (base32 "1bd8bsigfq9f00420bxj4snpcp4kr8x54y8kjx62a5q46diq231q"))))
|
| 66 |
|
| 67 | (define-public python-cirq-aqt
|
| 68 | (package
|
| 69 | (name "python-cirq-aqt")
|
| 70 | (version %cirq-version)
|
| 71 | (source %cirq-source)
|
| 72 | (build-system pyproject-build-system)
|
| 73 | (arguments
|
| 74 | (list
|
| 75 | #:tests? #f |
| 76 | #:phases
|
| 77 | #~(modify-phases %standard-phases
|
| 78 | (add-after 'unpack 'chdir
|
| 79 | (lambda _
|
| 80 | (chdir "cirq-aqt"))))))
|
| 81 | (native-inputs
|
| 82 | (list python-setuptools))
|
| 83 | (propagated-inputs
|
| 84 | (list python-cirq-core
|
| 85 | python-requests))
|
| 86 | (home-page %cirq-home-page)
|
| 87 | (synopsis "Cirq-AQT integration module")
|
| 88 | (description
|
| 89 | "This package provides an interface that allows Cirq quantum algorithms
|
| 90 | to run on quantum computers made by @url{https://www.aqt.eu/, Alpine Quantum
|
| 91 | Technologies GmbH}.")
|
| 92 | (license %cirq-license)))
|
| 93 |
|
| 94 | (define-public python-cirq-core
|
| 95 | (package
|
| 96 | (name "python-cirq-core")
|
| 97 | (version %cirq-version)
|
| 98 | (source %cirq-source)
|
| 99 | (build-system pyproject-build-system)
|
| 100 | (arguments
|
| 101 | (list
|
| 102 | #:test-flags
|
| 103 | |
| 104 | #~(list "--ignore=cirq/contrib")
|
| 105 | #:phases
|
| 106 | #~(modify-phases %standard-phases
|
| 107 | (add-after 'unpack 'chdir
|
| 108 | (lambda _
|
| 109 | (chdir "cirq-core")))
|
| 110 | (add-before 'sanity-check 'pre-check
|
| 111 | (lambda _
|
| 112 | (setenv "HOME" "/tmp")
|
| 113 | (setenv "NUMBA_CACHE_DIR" "/tmp"))))))
|
| 114 | (native-inputs
|
| 115 | (list python-freezegun
|
| 116 | python-ipython
|
| 117 | python-ply
|
| 118 | python-pylatex
|
| 119 | python-pytest
|
| 120 | python-pytest-benchmark
|
| 121 | python-setuptools))
|
| 122 | (propagated-inputs
|
| 123 | (list python-attrs
|
| 124 | python-duet
|
| 125 | python-matplotlib
|
| 126 | python-networkx
|
| 127 | python-numpy
|
| 128 | python-pandas
|
| 129 | python-quimb
|
| 130 | python-scipy
|
| 131 | python-scikit-learn
|
| 132 | python-sortedcontainers
|
| 133 | python-sympy
|
| 134 | python-tqdm))
|
| 135 | (home-page %cirq-home-page)
|
| 136 | (synopsis "Framework for creating, editing, and running NISQ circuits.")
|
| 137 | (description
|
| 138 | "This package provides a Python framework for creating, editing, and
|
| 139 | running Noisy Intermediate-Scale Quantum (NISQ) circuits. Built-in simulators
|
| 140 | are provided for running quantum algorithms. Algorithms can also be run on a
|
| 141 | variety of commercial quantum computing platforms by installing additional
|
| 142 | integrations.")
|
| 143 | (license %cirq-license)))
|
| 144 |
|
| 145 | (define-public python-cirq-google
|
| 146 | (package
|
| 147 | (name "python-cirq-google")
|
| 148 | (version %cirq-version)
|
| 149 | (source %cirq-source)
|
| 150 | (build-system pyproject-build-system)
|
| 151 | (arguments
|
| 152 | (list
|
| 153 | #:phases
|
| 154 | #~(modify-phases %standard-phases
|
| 155 | (add-after 'unpack 'chdir
|
| 156 | (lambda _
|
| 157 | (chdir "cirq-google"))))))
|
| 158 | (native-inputs
|
| 159 | (list python-setuptools))
|
| 160 | (propagated-inputs
|
| 161 | (list python-cirq-core
|
| 162 | python-google-api-core
|
| 163 | python-proto-plus
|
| 164 | python-protobuf-6
|
| 165 | python-typedunits))
|
| 166 | (home-page %cirq-home-page)
|
| 167 | (synopsis "Interface to Google's Quantum Computing Service")
|
| 168 | (description
|
| 169 | "This package provides an interface for Cirq to Google's Quantum Computing
|
| 170 | Service.")
|
| 171 | (license %cirq-license)))
|
| 172 |
|
| 173 | (define-public python-quimb
|
| 174 | (package
|
| 175 | (name "python-quimb")
|
| 176 | (version "1.14.0")
|
| 177 | (source
|
| 178 | (origin
|
| 179 | (method git-fetch)
|
| 180 | (uri (git-reference
|
| 181 | (url "https://github.com/jcmgray/quimb")
|
| 182 | (commit (string-append "v" version))))
|
| 183 | (file-name (git-file-name name version))
|
| 184 | (sha256
|
| 185 | (base32 "13h57cq183nb73j83jc2lrlcyy4km3d297arbps17wawq04wwyiv"))))
|
| 186 | (build-system pyproject-build-system)
|
| 187 | (arguments
|
| 188 | (list
|
| 189 | |
| 190 | #:test-flags
|
| 191 | |
| 192 | #~(list "--ignore=tests/test_tensor/test_tn1d/test_compress.py")
|
| 193 | #:phases
|
| 194 | #~(modify-phases %standard-phases
|
| 195 | |
| 196 | |
| 197 | |
| 198 | (add-before 'check 'set-env
|
| 199 | (lambda _
|
| 200 | (setenv "QUIMB_NUM_THREAD_WORKERS" "1"))))))
|
| 201 | (native-inputs
|
| 202 | (list python-hatch-vcs
|
| 203 | python-hatchling
|
| 204 | python-pytest))
|
| 205 | (propagated-inputs
|
| 206 | (list python-autoray
|
| 207 | python-cotengra
|
| 208 | python-cytoolz
|
| 209 | python-numba
|
| 210 | python-numpy
|
| 211 | python-psutil
|
| 212 | python-scipy
|
| 213 | python-tqdm))
|
| 214 | (home-page "https://quimb.readthedocs.io")
|
| 215 | (synopsis "Library for quantum information and many-body calculations")
|
| 216 | (description
|
| 217 | "This package provides a fast Python libray for performing quantum
|
| 218 | information and many-body calculations, focusing primarily on tensor
|
| 219 | networks.")
|
| 220 | (license license:asl2.0)))
|
| 221 |
|
| 222 | (define-public python-symmray
|
| 223 | (package
|
| 224 | (name "python-symmray")
|
| 225 | (version "0.4.0")
|
| 226 | (source
|
| 227 | (origin
|
| 228 | (method git-fetch)
|
| 229 | (uri (git-reference
|
| 230 | (url "https://github.com/jcmgray/symmray")
|
| 231 | (commit (string-append "v" version))))
|
| 232 | (file-name (git-file-name name version))
|
| 233 | (sha256
|
| 234 | (base32 "1zrb873jfh43k290i36lapvlhp7i5lx39p40yj2jia2ddjg9f7cg"))))
|
| 235 | (build-system pyproject-build-system)
|
| 236 | (arguments
|
| 237 | (list
|
| 238 | #:phases
|
| 239 | #~(modify-phases %standard-phases
|
| 240 | (add-before 'check 'set-env
|
| 241 | (lambda _
|
| 242 | (setenv "SYMMRAY_DEBUG" "1")
|
| 243 | (setenv "NUMBA_CACHE_DIR" "/tmp"))))))
|
| 244 | (native-inputs
|
| 245 | (list python-cotengra
|
| 246 | python-einops
|
| 247 | python-hatch-vcs
|
| 248 | python-hatchling
|
| 249 | python-numpy
|
| 250 | python-pytest
|
| 251 | python-quimb))
|
| 252 | (propagated-inputs
|
| 253 | (list python-autoray))
|
| 254 | (home-page "https://symmray.readthedocs.io")
|
| 255 | (synopsis "Minimal block sparse symmetric and fermionic tensor library")
|
| 256 | (description
|
| 257 | "Package @code{symmray} is minimal library for block sparse, abelian
|
| 258 | symmetric and fermionic arrays, designed to look as much as possible like
|
| 259 | standard ndarrays, whose blocks can be backed by @code{numpy}, @code{torch} or
|
| 260 | any other @code{autoray} compatible library.
|
| 261 |
|
| 262 | This library was developed in part for the work:
|
| 263 |
|
| 264 | Fermionic tensor network contraction for arbitrary geometries - Yang Gao,
|
| 265 | Huanchen Zhai, Johnnie Gray, Ruojing Peng, Gunhee Park, Wen-Yuan Liu, Eirik
|
| 266 | F. Kjønstad, Garnet Kin-Lic Chan -
|
| 267 | @url{https://doi.org/10.1103/PhysRevResearch.7.023193}.")
|
| 268 | (license license:asl2.0)))
|
| 269 |
|
| 270 | (define-public sbcl-rpcq
|
| 271 | (package
|
| 272 | (name "sbcl-rpcq")
|
| 273 | (version "3.10.0")
|
| 274 | (source
|
| 275 | (origin
|
| 276 | (method git-fetch)
|
| 277 | (uri (git-reference
|
| 278 | (url "https://github.com/rigetti/rpcq")
|
| 279 | (commit (string-append "v" version))))
|
| 280 | (file-name (git-file-name "cl-rpcq" version))
|
| 281 | (sha256
|
| 282 | (base32 "1bvppxlacvp0pfdbpn7ls1zxd127jacl225ds7lph5s8f8cyvf17"))))
|
| 283 | (build-system asdf-build-system/sbcl)
|
| 284 | (arguments
|
| 285 | (list
|
| 286 | |
| 287 | #:tests? #f))
|
| 288 | (native-inputs (list sbcl-fiasco))
|
| 289 | (inputs
|
| 290 | (list sbcl-alexandria
|
| 291 | sbcl-bordeaux-threads
|
| 292 | sbcl-cl-messagepack
|
| 293 | sbcl-cl-ppcre
|
| 294 | sbcl-cl-syslog
|
| 295 | sbcl-flexi-streams
|
| 296 | sbcl-local-time
|
| 297 | sbcl-parse-float
|
| 298 | sbcl-pzmq
|
| 299 | sbcl-trivial-backtrace
|
| 300 | sbcl-uuid
|
| 301 | sbcl-yason))
|
| 302 | (synopsis "RPC framework for Rigetti Quantum Cloud Services")
|
| 303 | (description
|
| 304 | "This package provides the asynchronous RPC client-server framework and
|
| 305 | message specification for Rigetti Quantum Cloud Services (QCS). It implements
|
| 306 | an efficient transport protocol by using ZeroMQ (ZMQ) sockets and MessagePack
|
| 307 | (msgpack) serialization.")
|
| 308 | (home-page "https://github.com/rigetti/rpcq")
|
| 309 | (license license:asl2.0)))
|
| 310 |
|
| 311 | (define-public cl-rpcq
|
| 312 | (sbcl-package->cl-source-package sbcl-rpcq))
|
| 313 |
|
| 314 | (define-public sbcl-cl-quil
|
| 315 | (package
|
| 316 | (name "sbcl-cl-quil")
|
| 317 | (version "1.26.0")
|
| 318 | (source
|
| 319 | (origin
|
| 320 | (method git-fetch)
|
| 321 | (uri (git-reference
|
| 322 | (url "https://github.com/quil-lang/quilc")
|
| 323 | (commit (string-append "v" version))))
|
| 324 | (file-name (git-file-name "cl-quil" version))
|
| 325 | (sha256
|
| 326 | (base32 "1s99lk456sw9hhsx5cf3x9r97iw9s3ydqsd94zz3bjnq77wmkhz5"))))
|
| 327 | (build-system asdf-build-system/sbcl)
|
| 328 | (arguments
|
| 329 | (list
|
| 330 | |
| 331 | #:tests? #f))
|
| 332 | (inputs
|
| 333 | (list sbcl-abstract-classes
|
| 334 | sbcl-alexa
|
| 335 | sbcl-alexandria
|
| 336 | sbcl-cl-algebraic-data-type
|
| 337 | sbcl-cl-grnm
|
| 338 | sbcl-cl-heap
|
| 339 | sbcl-cl-permutation
|
| 340 | sbcl-cl-yacc
|
| 341 | sbcl-global-vars
|
| 342 | sbcl-magicl
|
| 343 | sbcl-optima
|
| 344 | sbcl-parse-float
|
| 345 | sbcl-queues
|
| 346 | sbcl-salza2
|
| 347 | sbcl-split-sequence
|
| 348 | sbcl-trivial-garbage
|
| 349 | sbcl-yason))
|
| 350 | (synopsis "The optimizing Quil compiler")
|
| 351 | (description
|
| 352 | "Quil is the quantum instruction language, originally developed at
|
| 353 | Rigetti Computing. In Quil quantum algorithms are expressed using Quil's
|
| 354 | standard gates and instructions")
|
| 355 | (home-page "https://github.com/quil-lang/quilc")
|
| 356 | (license license:asl2.0)))
|
| 357 |
|
| 358 | (define-public cl-quil
|
| 359 | (sbcl-package->cl-source-package sbcl-cl-quil))
|
| 360 |
|
| 361 | (define-public sbcl-qvm
|
| 362 | (package
|
| 363 | (name "sbcl-qvm")
|
| 364 | (version "1.17.2")
|
| 365 | (source
|
| 366 | (origin
|
| 367 | (method git-fetch)
|
| 368 | (uri (git-reference
|
| 369 | (url "https://github.com/quil-lang/qvm")
|
| 370 | (commit (string-append "v" version))))
|
| 371 | (file-name (git-file-name "cl-qvm" version))
|
| 372 | (sha256
|
| 373 | (base32 "1cvmkqfcy7rv5jlim4kh4dvqhd3jk6mw1kwrphaqghjymrf72yp8"))))
|
| 374 | (build-system asdf-build-system/sbcl)
|
| 375 | (outputs '("out" "bin"))
|
| 376 | (inputs
|
| 377 | (list sbcl-abstract-classes
|
| 378 | sbcl-alexandria
|
| 379 | sbcl-cffi
|
| 380 | sbcl-cl-quil
|
| 381 | sbcl-global-vars
|
| 382 | sbcl-ieee-floats
|
| 383 | sbcl-lparallel
|
| 384 | sbcl-magicl
|
| 385 | sbcl-mt19937
|
| 386 | sbcl-static-vectors
|
| 387 | sbcl-trivial-features
|
| 388 | sbcl-trivial-garbage
|
| 389 |
|
| 390 | |
| 391 | sbcl-cl-syslog
|
| 392 | sbcl-command-line-arguments
|
| 393 | sbcl-hunchentoot
|
| 394 | sbcl-slime-swank
|
| 395 | sbcl-trivial-benchmark))
|
| 396 | (arguments
|
| 397 | (list
|
| 398 | #:asd-systems ''("qvm" "qvm-app")
|
| 399 | #:tests? #f
|
| 400 | #:phases
|
| 401 | #~(modify-phases %standard-phases
|
| 402 | (add-after 'unpack 'remove-git-dependency
|
| 403 | (lambda _
|
| 404 | (substitute* "app/src/qvm-app-version.lisp"
|
| 405 | (("\\(git-hash '#:qvm-app\\)")
|
| 406 | "\"unknown\""))))
|
| 407 | (add-after 'unpack 'fix-build
|
| 408 | (lambda _
|
| 409 | |
| 410 | (substitute* "app/src/entry-point.lisp"
|
| 411 | (("\\(defvar swank:\\*use-dedicated-output-stream\\*\\)")
|
| 412 | "")
|
| 413 | (("\\(setf swank:\\*use-dedicated-output-stream\\* nil\\)")
|
| 414 | ""))))
|
| 415 | (add-after 'create-asdf-configuration 'build-program
|
| 416 | (lambda* (#:key outputs #:allow-other-keys)
|
| 417 | (build-program (string-append (assoc-ref outputs "bin")
|
| 418 | "/bin/qvm")
|
| 419 | outputs
|
| 420 | #:dependencies '("qvm-app")
|
| 421 | #:entry-program '((qvm-app::asdf-entry-point))
|
| 422 | #:compress? #t))))))
|
| 423 | (synopsis "Quil simulator")
|
| 424 | (description
|
| 425 | "This is the official Quil-Lang Quantum Virtual Machine (QVM),
|
| 426 | a flexible and efficient simulator for Quil.")
|
| 427 | (home-page "https://github.com/quil-lang/qvm")
|
| 428 | (license (list license:asl2.0
|
| 429 | license:agpl3))))
|
| 430 |
|
| 431 | (define-public cl-qvm
|
| 432 | (sbcl-package->cl-source-package sbcl-qvm))
|