Skip to content

Commit

Permalink
run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquessV committed Oct 18, 2024
1 parent ee86ca7 commit 6cd4da6
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions pyquil_for_azure_quantum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@
from azure.quantum.target.rigetti import InputParams, Result, Rigetti, RigettiTarget
from lazy_object_proxy import Proxy
from numpy import split
from pyquil.api import (
QAM,
ExecutionOptions,
MemoryMap,
QAMExecutionResult,
QuantumComputer,
get_qc,
)
from pyquil.api import QAM, ExecutionOptions, MemoryMap, QAMExecutionResult, QuantumComputer, get_qc
from pyquil.quil import Program
from qcs_sdk import ExecutionData, RegisterData, ResultData # pylint: disable=no-name-in-module
from qcs_sdk.qvm import QVMResultData # pylint: disable=no-name-in-module
Expand Down Expand Up @@ -144,9 +137,7 @@ def get_qpu(qpu_name: str) -> AzureQuantumComputer:
Raises:
KeyError: If required environment variables are not set.
"""
return AzureQuantumComputer(
target=f"rigetti.qpu.{qpu_name.lower()}", qpu_name=qpu_name
)
return AzureQuantumComputer(target=f"rigetti.qpu.{qpu_name.lower()}", qpu_name=qpu_name)


def get_qvm() -> AzureQuantumComputer:
Expand Down Expand Up @@ -235,9 +226,7 @@ def execute( # type: ignore[override]
input_params = InputParams(
count=executable.num_shots,
skip_quilc=executable.skip_quilc,
substitutions={k: [v] for k, v in memory_map.items()}
if memory_map is not None
else None,
substitutions={k: [v] for k, v in memory_map.items()} if memory_map is not None else None,
)
job = self._target.submit(
str(executable),
Expand Down Expand Up @@ -345,11 +334,7 @@ def execute_with_memory_map_batch( # type: ignore
results.append(combined_result)
continue

ro_matrix = (
combined_result.data.result_data.to_register_map().get_register_matrix(
"ro"
)
)
ro_matrix = combined_result.data.result_data.to_register_map().get_register_matrix("ro")
if ro_matrix is None:
continue

Expand All @@ -358,9 +343,7 @@ def execute_with_memory_map_batch( # type: ignore
executable,
ExecutionData(
ResultData.from_qvm(
QVMResultData.from_memory_map(
memory={"ro": RegisterData(split_result.tolist())}
)
QVMResultData.from_memory_map(memory={"ro": RegisterData(split_result.tolist())})
)
),
)
Expand Down

0 comments on commit 6cd4da6

Please sign in to comment.