Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/github_actions/actions/setup-p…
Browse files Browse the repository at this point in the history
…ython-5
  • Loading branch information
yao-cqc authored Dec 11, 2023
2 parents 04d2214 + 0f7b5fc commit 861a1c4
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 101 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
pytketdoc_base = "https://tket.quantinuum.com/api-docs/"

intersphinx_mapping = {
"https://docs.python.org/3/": None,
pytketdoc_base: None,
"https://qiskit.org/documentation/": None,
"http://docs.qulacs.org/en/latest/": None,
"python": ("https://docs.python.org/3/", None),
"pytket": (pytketdoc_base, None),
"qiskit": ("https://qiskit.org/documentation/", None),
"qulacs": ("http://docs.qulacs.org/en/latest/", None),
}

autodoc_member_order = "groupwise"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx >= 4.3.2, <6.2.0
sphinx ~= 6.2
sphinx_book_theme >= 1.0.1, <2.0
sphinx-autodoc-typehints
sphinx-copybutton
enum-tools[sphinx]
8 changes: 8 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
~~~~~~~~~

Unreleased
----------

* ``QuantinuumBackend.cost()`` now raises an error if the ``syntax_checker``
argument doesn't correspond to the device's reported syntax checker or if it
specifies a device that isn't a syntax checker; and the method returns 0 if
called on syntax-checker backends.

0.26.0 (November 2023)
----------------------

Expand Down
20 changes: 2 additions & 18 deletions pytket/extensions/quantinuum/backends/api_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,14 @@ def __init__(
:param token_store: JWT Token store, defaults to None
A new MemoryCredentialStorage will be initialised
if None is provided.
:type token_store: CredentialStorage, optional
:param api_url: _description_, defaults to DEFAULT_API_URL
:type api_url: Optional[str], optional
:param api_version: API version, defaults to 1
:type api_version: int, optional
:param use_websocket: Whether to use websocket to retrieve, defaults to True
:type use_websocket: bool, optional
:param support_mfa: Whether to wait for the user to input the auth code,
defaults to True
:type support_mfa: bool, optional
:param session: Session for HTTP requests, defaults to None
A new requests.Session will be initialised if None
is provided
:type session: requests.Session, optional
"""
self.online = True

Expand Down Expand Up @@ -341,9 +335,7 @@ def retrieve_job_status(
Retrieves job status from device.
:param job_id: unique id of job
:type job_id: str
:param use_websocket: use websocket to minimize interaction
:type use_websocket: bool
:return: (dict) output from API
Expand All @@ -370,9 +362,7 @@ def retrieve_job(
Retrieves job from device.
:param job_id: unique id of job
:type job_id: str
:param use_websocket: use websocket to minimize interaction
:type use_websocket: bool
:return: (dict) output from API
Expand Down Expand Up @@ -471,7 +461,6 @@ def status(self, machine: str) -> str:
Check status of machine.
:param machine: machine name
:type machine: str
:return: (str) status of machine
Expand All @@ -491,7 +480,6 @@ def cancel(self, job_id: str) -> dict:
Cancels job.
:param job_id: job ID to cancel
:type job_id: str
:return: (dict) output from API
Expand Down Expand Up @@ -531,7 +519,6 @@ def __init__(self, machine_list: Optional[list] = None):
"n_shots": 10000,
"batching": True,
}
:type machine_list: list
"""
if machine_list == None:
machine_list = [
Expand Down Expand Up @@ -575,22 +562,19 @@ def _get_machine_list(self) -> Optional[list]:
return self.machine_list

def full_login(self) -> None:
"""No login offline with the offline API
:return: None"""
"""No login offline with the offline API"""

return None

def login(self) -> str:
"""No login offline with the offline API, this function will always
return an empty api token
:return: empty api token"""
return an empty api token"""
return ""

def _submit_job(self, body: Dict) -> None:
"""The function will take the submitted job and store it for later
:param body: submitted job
:type body: dict
:return: None
"""
Expand Down
7 changes: 0 additions & 7 deletions pytket/extensions/quantinuum/backends/leakage_gadget.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ def get_leakage_gadget_circuit(
:param circuit_qubit: Generated circuit detects whether leakage errors
have occurred in this qubit.
:type circuit_qubit: Qubit
:param postselection_qubit: Measured qubit to detect leakage error.
:type postselection_qubit: Qubit
:param postselection_bit: Leakage detection result is written to this bit.
:type postselection_bit: Bit
:return: Circuit for detecting leakage errors for specified ids.
:rtype: Circuit
"""
c = Circuit()
c.add_qubit(circuit_qubit)
Expand All @@ -63,13 +59,10 @@ def get_detection_circuit(circuit: Circuit, n_device_qubits: int) -> Circuit:
additional Bit are written to a new register "leakage_detection_bit".
:param circuit: Circuit to have leakage detection added.
:type circuit: Circuit
:param n_device_qubits: Total number of qubits supported by the device
being compiled to.
:type n_device_qubits: int
:return: Circuit with leakage detection circuitry added.
:rtype: Circuit
"""
n_qubits: int = circuit.n_qubits
if n_qubits == 0:
Expand Down
Loading

0 comments on commit 861a1c4

Please sign in to comment.