microsoft/qdk

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
billti/qdk_package

Branches

Tags

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

Clone

HTTPS

Download ZIP

source/pip/qsharp/interop/qiskit/__init__.py

39lines · modecode

1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3
4import json
5from typing import Any, Dict, List, Optional, Union
6
7from ...estimator import EstimatorParams, EstimatorResult
8from ..._native import OutputSemantics, ProgramType, QasmError
9from .backends import QSharpBackend, ResourceEstimatorBackend, QirTarget
10from .jobs import QsJob, QsSimJob, ReJob, QsJobSet
11from .execution import DetaultExecutor
12from qiskit import QuantumCircuit
13
14
15def estimate(
16 circuit: QuantumCircuit,
17 params: Optional[Union[Dict[str, Any], List, EstimatorParams]] = None,
18 **options,
19) -> EstimatorResult:
20 """
21 Estimates resources for Qiskit QuantumCircuit.
22
23 :param circuit: The input Qiskit QuantumCircuit object.
24 :param params: The parameters to configure physical estimation.
25 :**options: Additional options for the execution.
26 - Any options for the transpiler, exporter, or Qiskit passes
27 configuration. Defaults to backend config values. Common
28 values include: 'optimization_level', 'basis_gates',
29 'includes', 'search_path'.
30 :raises QasmError: If there is an error generating or parsing QASM.
31
32 :returns `EstimatorResult`: The estimated resources.
33 """
34 from ..._qsharp import ipython_helper
35
36 ipython_helper()
37 backend = ResourceEstimatorBackend()
38 job = backend.run(circuit, params=params, **options)
39 return job.result()
40