microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
source/pip/qsharp/interop/qiskit/backends/compilation.py
36lines · modecode
| 1 | # Copyright (c) Microsoft Corporation. |
| 2 | # Licensed under the MIT License. |
| 3 | |
| 4 | from qiskit import QuantumCircuit |
| 5 | |
| 6 | |
| 7 | class Compilation(dict): |
| 8 | def __init__(self, circuit: QuantumCircuit, qasm: str, time_taken: str): |
| 9 | super().__init__() |
| 10 | self["circuit"] = circuit |
| 11 | self["qasm"] = qasm |
| 12 | self["compilation_time_taken"] = time_taken |
| 13 | |
| 14 | @property |
| 15 | def circuit(self) -> QuantumCircuit: |
| 16 | return self["circuit"] |
| 17 | |
| 18 | @circuit.setter |
| 19 | def circuit(self, value: QuantumCircuit): |
| 20 | self["circuit"] = value |
| 21 | |
| 22 | @property |
| 23 | def qasm(self) -> str: |
| 24 | return self["qasm"] |
| 25 | |
| 26 | @qasm.setter |
| 27 | def qasm(self, value: str): |
| 28 | self["qasm"] = value |
| 29 | |
| 30 | @property |
| 31 | def time_taken(self) -> str: |
| 32 | return self["compilation_time_taken"] |
| 33 | |
| 34 | @time_taken.setter |
| 35 | def time_taken(self, value: str): |
| 36 | self["compilation_time_taken"] = value |
| 37 | |