Bram Evert
Bram Evert
### Code Snippet ```python import numpy as np from pyquil.quilbase import DefGate from pyquil.quilatom import quil_exp, Parameter phi = Parameter("phi") rz = np.array( [ [quil_exp(-1j*phi/2), 0], [0, quil_exp(+1j*phi/2)], ] )...
At line 337 of quilbase.py: ``` @property # type: ignore[override] def qubits(self) -> List[QubitDesignator]: return self.get_qubits(indices=False) # type: ignore ```
Issue Description ----------------- If I construct a program from a string, parameters such as "pi/2" are preserved and output that way. However, if I construct the same program in python,...
This code snippet shows that the real parameter value provided (pi) is converted to a complex value `(3.141592653589793+0j)`. ```python from numpy import pi import pyquil from pyquil.quil import Program from...
In pyquil 3, the unitary of a defined gate is determined by it's `DefGate`. However, in pyquil 4, in some cases the unitary is determined by it's `Defcal`. I believe...
```python from pyquil.quil import Program print(Program("DEFGATE DDXX_184:\n 1.0, 0.0\n 0.0, 1.0\n\nDDXX_184 2\nCPHASE(0.1) 0 1\nDECLARE ro BIT[3]\nMEASURE 0 ro[0]\nMEASURE 1 ro[1]\nMEASURE 2 ro[2]\n").out()) ``` Yields: ``` DECLARE ro BIT[3] DEFGATE DDXX_184...
The method `program_unitary` ought to interpret defgates. Secondly, it would be useful to document that the function returns the unitary in a non-conventional order and add a flag to return...
Issue Description ----------------- The NumpyWavefunctionSimulator is about four times slower under pyquil 4. How to Reproduce ---------------- If useful, provide a numbered list of the steps that result in the...
Issue Description ----------------- In some cases, programs are combined like so: ```python sum((program for _ in range(100)), Program()); ``` This is used in forest-benchmarking for example. When the program is...
### Code Snippet ```python import pyquil import numpy as np from pyquil.quil import Program from pyquil.quilbase import DefGate print(pyquil.__version__) program = Program() program += DefGate("BLARG", np.eye(2), []) print(program) ``` ###...