示例#1
0
 def exitWait(self, ctx):
     # type: (QuilParser.WaitContext) -> None
     self.result.append(Wait())
示例#2
0
 def wait(self):
     return Wait()
示例#3
0
文件: gates.py 项目: timasq/pyquil
                  [0, 0,             0,             1]]

    This is a parameterized swap gate.

    :param angle: The angle of the phase to apply to the swapped states. This phase is applied to
        q1 when it is in the excited state and to q2 when it is in the ground state.
    :param q1: Qubit 1.
    :param q2: Qubit 2.
    :returns: A Gate object.
    """
    return Gate(name="PSWAP",
                params=[angle],
                qubits=[unpack_qubit(q) for q in (q1, q2)])


WAIT = Wait()
"""
This instruction tells the quantum computation to halt. Typically these is used while classical memory is being
manipulated by a CPU in a hybrid classical/quantum algorithm.

:returns: A Wait object.
"""


def RESET(qubit_index=None):
    """
    Reset all qubits or just a specific qubit at qubit_index.

    :param Optional[int] qubit_index: The address of the qubit to reset.
        If None, reset all qubits.
    :returns: A Reset or ResetQubit Quil AST expression corresponding to a global or targeted