Skip to content

Commit

Permalink
V4: The rest of the non control-flow instructions (#1568)
Browse files Browse the repository at this point in the history
* ClassicalConvert tests

* tests for Classical(Exchange|Load|Move)

* ClassicalStore tests

* test ClassicalComparison classes

* test UnaryClassicalInstructions

* Include implementation and test

* Wait, Halt, Nop test and implementation

* implement ClassicalConvert

* re-implement ClassicalLoad

* re-implement ClassicalStore

* re-implement ClassicalComparison

* re-implement Exchange

* re-implement ClassicalUnary

* back ClassicalMove, ClassicalExchange with quil-rs

* fix recursive implementation of SimpleInstruction.__str__
  • Loading branch information
MarquessV authored May 1, 2023
1 parent 4a06343 commit b36d8ff
Show file tree
Hide file tree
Showing 5 changed files with 521 additions and 93 deletions.
3 changes: 3 additions & 0 deletions pyquil/quilatom.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ def _from_parameter_str(cls, memory_reference_str: str) -> "MemoryReference":
return cls._from_rs_memory_reference(expression.to_address())
raise ValueError(f"{memory_reference_str} is not a memory reference")

def _to_rs_memory_reference(self) -> quil_rs.MemoryReference:
return quil_rs.MemoryReference(self.name, self.offset)

def out(self) -> str:
if self.declared_size is not None and self.declared_size == 1 and self.offset == 0:
return "{}".format(self.name)
Expand Down
Loading

0 comments on commit b36d8ff

Please sign in to comment.