Skip to content

Commit

Permalink
Apply formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
keriksson-rosenqvist committed Jul 3, 2024
1 parent 3781ea3 commit ba9fdd4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/QAT_RPC/qat_rpc/zmq/qat_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

from qat_rpc.zmq.wrappers import ZMQClient


parser = argparse.ArgumentParser(prog="QAT submission service", description="Submit your QASM or QIR program to QAT.")
parser = argparse.ArgumentParser(
prog="QAT submission service", description="Submit your QASM or QIR program to QAT."
)
parser.add_argument("program", type=str, help="Program string or path to program file.")
parser.add_argument("--config", type=str, help="Serialised CompilerConfig json")

Expand Down
7 changes: 3 additions & 4 deletions src/QAT_RPC/qat_rpc/zmq/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from typing import Union

import zmq

from qat.purr.backends.echo import get_default_echo_hardware
from qat.purr.compiler.hardware_models import QuantumHardwareModel
from qat.purr.compiler.config import CompilerConfig
from qat.purr.compiler.hardware_models import QuantumHardwareModel
from qat.purr.compiler.runtime import get_runtime
from qat.qat import execute_with_metrics

Expand Down Expand Up @@ -56,7 +55,7 @@ def __del__(self):


class ZMQServer(ZMQBase):
def __init__(self, hardware: QuantumHardwareModel=None):
def __init__(self, hardware: QuantumHardwareModel = None):
super().__init__(zmq.REP)
self._socket.bind(self.address)
self._hardware = hardware or get_default_echo_hardware(qubit_count=32)
Expand Down Expand Up @@ -91,7 +90,7 @@ def __init__(self):
self._socket.setsockopt(zmq.LINGER, 0)
self._socket.connect(self.address)

def execute_task(self, program: str, config: Union[CompilerConfig, str]=None):
def execute_task(self, program: str, config: Union[CompilerConfig, str] = None):
self.result = None
if isinstance(config, str):
# Verify config string is valid before submitting.
Expand Down
8 changes: 4 additions & 4 deletions src/tests/zmq/test_wrappers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
import threading

import pytest
from qat.purr.compiler.config import CompilerConfig

from qat_rpc.zmq.wrappers import ZMQClient, ZMQServer
Expand Down Expand Up @@ -61,18 +61,18 @@ def test_two_zmq_clients():
config0.repeats = 100
thread00 = threading.Thread(
target=execute_and_check_result,
args=(client0, program, config0, {"c": { "00": 100}}),
args=(client0, program, config0, {"c": {"00": 100}}),
)
thread01 = threading.Thread(
target=execute_and_check_result,
args=(client0, program, config0, {"c": { "00": 100}}),
args=(client0, program, config0, {"c": {"00": 100}}),
)
config1 = CompilerConfig()
config1.results_format.binary_count()
config1.repeats = 1000
thread10 = threading.Thread(
target=execute_and_check_result,
args=(client1, program, config1, {"c": { "00": 1000}}),
args=(client1, program, config1, {"c": {"00": 1000}}),
)
thread00.start()
thread01.start()
Expand Down

0 comments on commit ba9fdd4

Please sign in to comment.