microsoft/qdk

Public

mirrored from https://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fedimser/test-utils-1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

source/pip/qsharp/__init__.py

84lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4"""Deprecated: The ``qsharp`` package has been replaced by ``qdk``.
5
6All functionality previously available in ``qsharp`` is now provided by the
7``qdk`` package. This package is a thin compatibility shim that re-exports the
8``qdk`` public API so that existing code continues to work.
9
10To migrate, replace ``import qsharp`` with ``from qdk import qsharp`` or
11``import qdk`` and use the ``qdk.*`` namespace directly.
12"""
13
14import warnings as _warnings
15
16_warnings.warn(
17 "The 'qsharp' package is deprecated and will be removed in a future release. "
18 "Please use the 'qdk' package instead. "
19 "See https://github.com/microsoft/qdk/wiki/Migrating-from-qsharp-to-qdk for migration guidance.",
20 DeprecationWarning,
21 stacklevel=2,
22)
23
24# Re-export the public API from qdk.qsharp so that existing code keeps working.
25from qdk.qsharp import ( # noqa: F401
26 StateDump,
27 ShotResult,
28 PauliNoise,
29 DepolarizingNoise,
30 BitFlipNoise,
31 PhaseFlipNoise,
32 init,
33 eval,
34 run,
35 compile,
36 circuit,
37 estimate,
38 logical_counts,
39 set_quantum_seed,
40 set_classical_seed,
41 dump_machine,
42 dump_circuit,
43 Result,
44 Pauli,
45 QSharpError,
46 TargetProfile,
47 estimate_custom,
48 CircuitGenerationMethod,
49)
50
51# Re-export submodules that were previously loaded as side effects
52# (e.g. ``_qsharp.py`` did ``from . import code``) so that attribute
53# access like ``qsharp.code`` keeps working after a bare ``import qsharp``.
54from . import code, estimator # noqa: F401
55
56from qdk import telemetry_events
57
58telemetry_events.on_import()
59
60__all__ = [
61 "init",
62 "eval",
63 "run",
64 "set_quantum_seed",
65 "set_classical_seed",
66 "dump_machine",
67 "dump_circuit",
68 "compile",
69 "circuit",
70 "estimate",
71 "estimate_custom",
72 "logical_counts",
73 "Result",
74 "Pauli",
75 "QSharpError",
76 "TargetProfile",
77 "StateDump",
78 "ShotResult",
79 "PauliNoise",
80 "DepolarizingNoise",
81 "BitFlipNoise",
82 "PhaseFlipNoise",
83 "CircuitGenerationMethod",
84]
85