diff --git a/samples/python_interop/cirq_submission_to_azure.ipynb b/samples/python_interop/cirq_submission_to_azure.ipynb index bb55e1c7c3..fdfadd15b1 100644 --- a/samples/python_interop/cirq_submission_to_azure.ipynb +++ b/samples/python_interop/cirq_submission_to_azure.ipynb @@ -32,7 +32,7 @@ "source": [ "## Prerequisites\n", "\n", - "Ensure the `qdk` package (with Azure extra) and `cirq` are installed. If not, install dependencies below." + "Ensure the `qdk` package is installed with `azure` and `cirq` extras. If not, install dependencies below." ] }, { @@ -42,7 +42,7 @@ "metadata": {}, "outputs": [], "source": [ - "%pip install \"qdk[azure]\" cirq" + "%pip install \"qdk[azure,cirq]\"" ] }, { diff --git a/source/qdk_package/README.md b/source/qdk_package/README.md index 9841e5171b..7ffda46294 100644 --- a/source/qdk_package/README.md +++ b/source/qdk_package/README.md @@ -1,6 +1,6 @@ # qdk -The Quantum Development Kit (QDK) provides a single, cohesive Python entry point for compiling, simulating, and estimating resources for quantum programs (Q# and OpenQASM), with optional extras for visualization, cloud workflows, and Qiskit interoperability. +The Quantum Development Kit (QDK) provides a single, cohesive Python entry point for compiling, simulating, and estimating resources for quantum programs (Q# and OpenQASM), with optional extras for visualization, cloud workflows, and interoperability with Qiskit and Cirq. ## Install @@ -28,6 +28,12 @@ For Qiskit integration, which exposes Qiskit interop utilities in the `qdk.qiski pip install "qdk[qiskit]" ``` +For Cirq integration, which exposes Cirq interop utilities in the `qdk.azure.cirq` submodule: + +```bash +pip install "qdk[cirq]" +``` + To easily install all the above extras: ```bash diff --git a/source/qdk_package/pyproject.toml b/source/qdk_package/pyproject.toml index 55de56be83..de65a2d17f 100644 --- a/source/qdk_package/pyproject.toml +++ b/source/qdk_package/pyproject.toml @@ -16,10 +16,13 @@ dependencies = ["qsharp==0.0.0"] jupyter = ["qsharp-widgets==0.0.0", "qsharp-jupyterlab==0.0.0"] azure = ["azure-quantum>=3.5.0"] qiskit = ["qiskit>=1.2.2,<3.0.0"] +cirq = ["cirq-core>=1.3.0,<=1.4.1", "cirq-ionq>=1.3.0,<=1.4.1"] all = [ "qsharp-widgets==0.0.0", "azure-quantum>=3.5.0", "qiskit>=1.2.2,<3.0.0", + "cirq-core>=1.3.0,<=1.4.1", + "cirq-ionq>=1.3.0,<=1.4.1", "qsharp-jupyterlab==0.0.0", ] diff --git a/source/qdk_package/src/qdk/azure/cirq.py b/source/qdk_package/src/qdk/azure/cirq.py new file mode 100644 index 0000000000..02d2b71b78 --- /dev/null +++ b/source/qdk_package/src/qdk/azure/cirq.py @@ -0,0 +1,18 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +"""qdk.azure.cirq: re-export of azure.quantum.cirq symbols. + +Requires installation: ``pip install \"qdk[azure,cirq]\"``. + +Example: + from qdk.azure.cirq import + +""" + +try: + from azure.quantum.cirq import * # pyright: ignore[reportWildcardImportFromLibrary] +except Exception as ex: + raise ImportError( + "qdk.azure.cirq requires the azure and cirq extras. Install with 'pip install \"qdk[azure,cirq]\"'." + ) from ex diff --git a/source/qdk_package/src/qdk/azure/target.py b/source/qdk_package/src/qdk/azure/target/__init__.py similarity index 100% rename from source/qdk_package/src/qdk/azure/target.py rename to source/qdk_package/src/qdk/azure/target/__init__.py diff --git a/source/qdk_package/src/qdk/azure/target/rigetti.py b/source/qdk_package/src/qdk/azure/target/rigetti.py new file mode 100644 index 0000000000..639aed7540 --- /dev/null +++ b/source/qdk_package/src/qdk/azure/target/rigetti.py @@ -0,0 +1,11 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +"""Submodule re-export for azure.quantum.target.rigetti as qdk.azure.target.rigetti.""" + +try: + from azure.quantum.target.rigetti import * # pyright: ignore[reportWildcardImportFromLibrary] +except Exception as ex: + raise ImportError( + "qdk.azure requires the azure extra. Install with 'pip install qdk[azure]'." + ) from ex