Saravanan666/pypi-org huggingface dataset:
Package: pytkdocs-tweaks
pytkdocs_tweaksSome custom tweaks forpytkdocs.For use as part of the documentation-generation-for-Python stack that comprisesmkdocs,mkdocs-material,mkdocstringsandpytkdocs.Types are ubiquitously displayed in the way you import them:package.Foo(rather than being a mix of where they're defined:package.subpackage.foomodule.Fooor just their name:Foo).Only public base classes are shown (rather than every base class).Adds short documentation for inherited and implemented methods, e.g. "Inherited frompackage.Foo." (Rather than nothing at all.)An inherited method is one inherited from a base class. An implemented method is one overriding an abstract method on a base class.Sets a customtyping.GENERATING_DOCUMENTATION = Trueflag that you can use to detect when documentation generation is happening and customise things if desired (documentation generation imports the library you're documenting).Adds anabstractmethod/abstractpropertyproperty to appear in the documentation instead. (Useful when specifying abstract base classes.)Removed thedataclassandspecialproperties that appear in the documentation. (I find that these just add visual noise.)Removed the-> Nonereturn annotation on__init__methods.Function-valued defaults now display as just<function foo>rather than<function foo at 0x7f5428d27a60>.Note that you must run themkdocscommand twice, as these custom tweaks write a cache to disk -- listing all the public objects -- that are then used on the second run. If you see a.all_objects.cachefile appear -- this is why. (You may wish to add the file to your.gitignore.)Installationpipinstallpytkdocs_tweaksRequires Python 3.8+ andpytkdocs==0.15.0.UsageIn yourmkdocs.yml:plugins:
    - search  # default plugin, need to re-enable when using manual plugins
    - mkdocstrings:
        handlers:
            python:
                setup_commands:
                    - import pytkdocs_tweaks
                    - pytkdocs_tweaks.main()
                selection:
                    inherited_members: true  # allow looking up inherited members
                rendering:
                    show_root_heading: true    #
                    show_root_full_path: true  # have e.g. `package.Foo` display correctly, rather than e.g. just `Foo`.
Package: pytket
Pytket is a python module for interfacing with TKET, an optimising compiler for quantum circuits developed byQuantinuum. In addition to pytket there are several extension modules for accessing a range of quantum hardware and classical simulators. The extension modules also provide integration with several widely used quantum software tools.The source code for the TKET compiler can be found inthis github repository.InstallationInstallation is supported for Linux, MacOS and Windows. Installation requires python 3.10, 3.11 or 3.12.To install run the pip command:pip install pytketSeeInstallation troubleshootingfor help with installation.To install the pytket extension modules add a hyphen and the extension name to the command:pip install pytket-quantinuumFor a list of pytket extensions see this page:https://tket.quantinuum.com/api-docs/extensions.Warning.There is aknown issuewith installing pytket in a conda environment on MacOS: you may not be able to
install versions more recent then 1.11.0. The only known remedy is to use an
official Python distribution instead.Documentation and ExamplesAPI reference:https://cqcl.github.io/tket/pytket/api/To get started using pytket see theuser manual.For worked examples using TKET see ournotebook examples.Support and DiscussionFor bugs and feature requests we recommend creating an issue on thegithub repository.User support:tket-support@cambridgequantum.comFor discussion, join the public slack channelhere.Mailing list: joinhere.CitationIf you wish to cite TKET in any academic publications, we generally recommend citing oursoftware overviewpaper for most cases.If your work is on the topic of specific compilation tasks, it may be more appropriate to cite one of our other papers:"On the qubit routing problem" for qubit placement (a.k.a. allocation) and routing (a.k.a. swap network insertion, connectivity solving).https://arxiv.org/abs/1902.08091."Phase Gadget Synthesis for Shallow Circuits" for representing exponentiated Pauli operators in the ZX calculus and their circuit decompositions.https://arxiv.org/abs/1906.01734."A Generic Compilation Strategy for the Unitary Coupled Cluster Ansatz" for sequencing of terms in Trotterisation and Pauli diagonalisation.https://arxiv.org/abs/2007.10515.
Package: pytket-braket
pytket-braketPytketis a python module for interfacing
with CQC tket, a set of quantum programming tools.pytket-braketis an extension topytketthat allowspytketcircuits to be
executed on a range of devices and simulators via Amazon's Braket service.Some useful links:API DocumentationGetting startedpytket-braketis available for Python 3.10 and 3.11, on Linux, MacOS
and Windows, and Python 3.12 on Linux and MacOS. To install, run:pipinstallpytket-braketThis will installpytketif it isn't already installed, and add new classes
and methods into thepytket.extensionsnamespace.Bugs and feature requestsPlease file bugs and feature requests on the Githubissue tracker.DevelopmentTo install an extension in editable mode, simply change to its subdirectory
within themodulesdirectory, and run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleFormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 20.8b1.Type annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmodules/mypy-check(passing as a single argument the root directory of the module to test). The
script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytest,hypothesis, and any modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.
Package: pytket-cirq
pytket-cirqPytketis a python module for interfacing
with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.pytket-cirqis an extension topytketthat allows conversion to and from
Cirq representations.Getting startedpytket-cirqis available for Python 3.10, 3.11 and 3.12, on Linux, MacOS
and Windows. To install, run:pipinstallpytket-cirqThis will installpytketif it isn't already installed, and add new classes
and methods into thepytket.extensionsnamespace.Bugs, support and feature requestsPlease file bugs and feature requests on the Githubissue tracker.There is also a Slack channel for discussion and support. Clickhereto join.DevelopmentTo install an extension in editable mode, simply change to its subdirectory
within themodulesdirectory, and run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleFormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 22.3.Type annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmodules/mypy-check(passing as a single argument the root directory of the module to test). The
script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytest,hypothesis, and any modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.
Package: pytket-cutensornet
pytket-cutensornetPytketis a python module for interfacing
with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.cuTensorNetis a
high-performance library for tensor network computations, developed by NVIDIA.
It is part of thecuQuantumSDK -
a high-performance library aimed at quantum circuit simulations on the NVIDIA GPU chips,
consisting of two major components:cuStateVec: a high-performance library for state vector computations.cuTensorNet: a high-performance library for tensor network computations.Both components have both C and Python API.pytket-cutensornetis an extension topytketthat allowspytketcircuits and
expectation values to be simulated usingcuTensorNetvia an interface tocuQuantum Python.Currently, only single-GPU calculations are supported, but a multi-GPU execution will be
implemented in the due course usingmpi4pylibrary.Getting startedpytket-cutensornetis available for Python 3.10, 3.11 and 3.12 on Linux.
In order to use it, you need access to a Linux machine with an NVIDIA GPU of
Compute Capability +7.0 (check ithere) and first
installcuQuantum Pythonfollowing their installationinstructions.
This will include the necessary dependencies such as CUDA toolkit. Then, to installpytket-cutensornet, run:pipinstallpytket-cutensornetBugs, support and feature requestsPlease file bugs and feature requests on the Githubissue tracker.DevelopmentTo install an extension in editable mode, from its root folder run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleDocstringsWe use the Google style docstrings, please see thispagefor
reference.FormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 22.12.0. You can install it
(as well as pylint as described below) by running from the root package folder:pipinstall-rlint-requirements.txtType annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmypy-checkand passing as a single argument the root directory of the module to test. The directory
path should end with a/. For example, to run mypy on all Python files in this
repository, when in the root folder, run:./mypy-check./The script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytestand any other modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.
Package: pytket-ionq
Pytket ExtensionsThis repository contains the pytket-ionq extension, using Quantinuum'spytketquantum SDK.pytket-ionqPytketis a python module for interfacing
with tket, a quantum computing toolkit and optimisation compiler developed by Quantinuum.pytket-ionqis an extension topytketthat allowspytketcircuits to be
executed on IonQ's quantum devices and simulators.Getting startedpytket-ionqis available for Python 3.8, 3.9 and 3.10, on Linux, MacOS
and Windows. To install, run:pip install pytket-ionqThis will installpytketif it isn't already installed, and add new classes
and methods into thepytket.extensionsnamespace.Bugs, support and feature requestsPlease file bugs and feature requests on the Githubissue tracker.There is also a Slack channel for discussion and support. Clickhereto join.DevelopmentTo install an extension in editable mode, simply change to its subdirectory
within themodulesdirectory, and run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleFormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 20.8b1.Type annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmodules/mypy-check(passing as a single argument the root directory of the module to test). The
script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytest,hypothesis, and any modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.
Package: pytket-offline-display
Pytket-offline-displayThispytketextension package provides offline circuit rendering functionality.
To use, first install the package withpip:pipinstallpytket-offline-displayThen replace the usualpytket.circuit.displayimport withpytket.extensions.offline_display. For example:frompytket.extensions.offline_displayimportrender_circuit_jupyterfrompytketimportCircuitcirc=Circuit(2,2)circ.H(0)circ.CX(0,1)circ.measure_all()render_circuit_jupyter(circ)If you want to control the default options, you can instead load a configurable instance.
(Note that this requires pytket >= 1.15)frompytket.extensions.offline_displayimportget_circuit_renderercircuit_renderer=get_circuit_renderer()circuit_renderer.set_display_options(zx_style=False)# set the default options.circuit_renderer.dark_mode=True# You can also set them directly.circuit_renderer.render_circuit_jupyter(circ)
Package: pytket-pennylane
pytket-pennylanePytketextension andPennyLaneplugin which allows pytket backends and compilation to be used as a PennyLane device.Pytket is a quantum SDK python package which provides state of the art compilation for quantum
circuits and a unified interface for execution on a number of "backends" (devices and simulators).
PennyLane is a package for differentiable programming of quantum computer, which also provides a way
to execute circuits on a variety of "devices". This package allows users to easily leverage the
differentiablecircuits of PennyLane combined with the compilation available in Pytket.The package is available for python 3.10, 3.11 and 3.12, and can be installed by
cloning and installing from source, or via pip:pipinstallpytket-pennylaneAPI documentation ishere.See the PennyLanedocumentationand Pytketdocumentationto get an intro to PennyLane and Pytket.To use the integration once installed, initialise your pytket backend (in this example, anAerBackendwhich uses Qiskit Aer), and construct a PennyLanePytketDeviceusing this backend:importpennylaneasqmlfrompytket.extensions.qiskitimportAerBackend# initialise pytket backendpytket_backend=AerBackend()# construct PennyLane devicedev=qml.device("pytket.pytketdevice",wires=2,pytket_backend=pytket_backend,shots=1000)# define a PennyLane Qnode with this device@qml.qnode(dev)defmy_quantum_function(x,y):qml.RZ(x,wires=0)qml.RX(y,wires=1)returnqml.expval(qml.PauliZ(0)@qml.PauliZ(1))# call the nodeprint(my_quantum_function(0.1,0.2))The example above uses the Pytket default compilation pass for the backend, you can change the optimisation
level of the default backend pass (0, 1 or 2) by setting theoptimisation_levelparameter:dev=qml.device("pytket.pytketdevice",wires=2,pytket_backend=pytket_backend,optimisation_level=2,shots=1000)You can also use any Pytketcompilation passusing thecompilation_passparameter, which is used instead of the default pass:frompytket.passesimportPauliSimp,SequencePass# use a Chemistry optimised pass before the backend's default passcustom_pass=SequencePass([PauliSimp(),pytket_backend.default_compilation_pass()])dev=qml.device("pytket.pytketdevice",wires=2,pytket_backend=pytket_backend,compilation_pass=custom_pass,shots=1000)
Package: pytket-phir
pytket-phirPHIR stands forPECOSHigh-level Intermediate Representation.
SeePHIR specificationfor more.pytket-phiris a circuit analyzer and translator frompytketto PHIR.Also included is the CLI toolphircthat takes QASM programs as input and emulates them using PECOS.PrerequisitesPython >=3.10InstallationJust issuepip install pytket-phirto obtain the latest stable release.phirc CLIThe package includes a tool for emulating QASM files from the command line using PECOS.Install additional dependencies needed for the CLI usingpip install pytket-phir[phirc].❯phirc-h
usage:phirc[-h][-wWASM_FILE][-m{H1-1,H1-2}][-v][--version]qasm_files[qasm_files...]EmulatesQASMprogramexecutionviaPECOS

positionalarguments:qasm_filesOneormoreQASMfilestoemulate

options:-h,--helpshowthishelpmessageandexit-wWASM_FILE,--wasm-fileWASM_FILEOptionalWASMfileforusebytheQASMprograms-m{H1-1,H1-2},--machine{H1-1,H1-2}Machinename,H1-1bydefault-v,--verbose--versionshowprogram'sversionnumberandexitDevelopmentClone the repository and run:python-mvenv.venvsource.venv/bin/activate
pipinstall-Upipsetuptools
pipinstall-rrequirements.txt
pre-commitinstallThen, install the project using:pipinstall-e.SeeMakefilefor other useful commands.TestingIssuepytestfrom the root directory.
Package: pytket-projectq
pytket-projectqPytketis a python module for interfacing
with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.pytket-projectqis an extension topytketthat allowspytketcircuits to
be run on ProjectQ simulators, as well as conversion to the ProjectQ
representation.Getting startedpytket-projectqis available for Python 3.10, 3.11 and 3.12, on Linux, MacOS
and Windows. To install, run:pipinstallpytket-projectqThis will installpytketif it isn't already installed, and add new classes
and methods into thepytket.extensionsnamespace.Bugs, support and feature requestsPlease file bugs and feature requests on the Githubissue tracker.There is also a Slack channel for discussion and support. Clickhereto join.DevelopmentTo install an extension in editable mode, simply change to its subdirectory
within themodulesdirectory, and run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleFormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 20.8b1.Type annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmodules/mypy-check(passing as a single argument the root directory of the module to test). The
script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytest,hypothesis, and any modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.
Package: pytket-pyquil
pytket-pyquilPytketis a python module for interfacing
with tket, a quantum computing toolkit and optimising compiler developed by Quantinuum.pytket-pyquilis an extension topytketthat allowspytketcircuits to be
run on Rigetti backends and simulators, as well as conversion to and from pyQuil
representations.Getting startedpytket-pyquilis available for Python 3.10, 3.11 and 3.12, on Linux, MacOS
and Windows. To install, run:pipinstallpytket-pyquilThis will installpytketif it isn't already installed, and add new classes
and methods into thepytket.extensionsnamespace.Bugs, support and feature requestsPlease file bugs and feature requests on the Githubissue tracker.There is also a Slack channel for discussion and support. Clickhereto join.DevelopmentTo install an extension in editable mode, simply change to its subdirectory
within themodulesdirectory, and run:pipinstall-e.ContributingPull requests are welcome. To make a PR, first fork the repo, make your proposed
changes on thedevelopbranch, and open a PR from your fork. If it passes
tests and is accepted after review, it will be merged in.Code styleFormattingAll code should be formatted usingblack, with default options. This is
checked on the CI. The CI is currently using version 22.3.Type annotationOn the CI,mypyis used as a static
type checker and all submissions must pass its checks. You should therefore runmypylocally on any changed files before submitting a PR. Because of the way
extension modules embed themselves into thepytketnamespace this is a little
complicated, but it should be sufficient to run the scriptmodules/mypy-check(passing as a single argument the root directory of the module to test). The
script requiresmypy0.800 or above.LintingWe usepylinton the CI to check compliance
with a set of style requirements (listed in.pylintrc). You should runpylintover any changed files before submitting a PR, to catch any issues.TestsTo run the tests for a module:cdinto that module'stestsdirectory;ensure you have installedpytest,hypothesis, and any modules listed in
thetest-requirements.txtfile (all viapip);runpytest.When adding a new feature, please add a test for it. When fixing a bug, please
add a test that demonstrates the fix.