Skip to content

Commit

Permalink
a few more cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
MarquessV committed Aug 10, 2023
1 parent 02b4d3b commit 545f180
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 1 addition & 4 deletions pyquil/api/_qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class QPUExecuteResponse:
job_id: str
_executable: EncryptedProgram
execution_options: Optional[ExecutionOptions]
_memory_map: MemoryMap


class QPU(QAM[QPUExecuteResponse]):
Expand Down Expand Up @@ -198,9 +197,7 @@ def execute(
execution_options=execution_options or self.execution_options,
)

return QPUExecuteResponse(
_executable=executable, job_id=job_id, execution_options=execution_options, _memory_map=memory_map
)
return QPUExecuteResponse(_executable=executable, job_id=job_id, execution_options=execution_options)

def get_result(self, execute_response: QPUExecuteResponse) -> QAMExecutionResult:
"""
Expand Down
7 changes: 3 additions & 4 deletions pyquil/api/_qvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
# limitations under the License.
##############################################################################
from dataclasses import dataclass
from typing import Any, Optional, Sequence, Tuple
from typing import Any, Optional, Sequence, Tuple, Dict

import numpy as np
from qcs_sdk import QCSClient, qvm, ResultData, ExecutionData
from qcs_sdk.qvm import QVMOptions, QVMResultData

Expand Down Expand Up @@ -52,7 +53,7 @@ class QVMExecuteResponse:
data: QVMResultData

@property
def memory(self):
def memory(self) -> Dict[str, np.ndarray]:
register_map = self.data.to_register_map()
return {key: matrix.to_ndarray() for key, matrix in register_map.items()}

Expand Down Expand Up @@ -158,8 +159,6 @@ def execute(
def get_result(self, execute_response: QVMExecuteResponse) -> QAMExecutionResult:
"""
Return the results of execution on the QVM.
Because QVM execution is synchronous, this is a no-op which returns its input.
"""

result_data = ResultData(execute_response.data)
Expand Down

0 comments on commit 545f180

Please sign in to comment.