Exemplo n.º 1
0
 def known_qasm_output(self,
                       qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     args.validate_version('2.0')
     return args.format(
             'u3({0:half_turns},{1:half_turns},{2:half_turns}) {3};\n',
             self.theta, self.phi, self.lmda, qubits[0])
Exemplo n.º 2
0
 def known_qasm_output(self,
                       qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     if self.half_turns != 1:
         return None  # Don't have an equivalent gate in QASM
     args.validate_version('2.0')
     return args.format('cz {0},{1};\n', qubits[0], qubits[1])
Exemplo n.º 3
0
 def known_qasm_output(self, qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     args.validate_version('2.0')
     if self.half_turns == 1:
         return args.format('z {0};\n', qubits[0])
     else:
         return args.format('rz({0:half_turns}) {1};\n', self.half_turns,
                            qubits[0])
Exemplo n.º 4
0
 def known_qasm_output(self,
                       qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     args.validate_version('2.0')
     if self.half_turns == 1:
         return args.format('z {0};\n', qubits[0])
     else:
         return args.format('rz({0:half_turns}) {1};\n',
                            self.half_turns, qubits[0])
Exemplo n.º 5
0
 def known_qasm_output(self, qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     if self.half_turns != 1:
         return None  # Don't have an equivalent gate in QASM
     args.validate_version('2.0')
     return args.format('cz {0},{1};\n', qubits[0], qubits[1])
Exemplo n.º 6
0
 def known_qasm_output(self, qubits: Tuple[ops.QubitId, ...],
                       args: ops.QasmOutputArgs) -> Optional[str]:
     args.validate_version('2.0')
     return args.format(
         'u3({0:half_turns},{1:half_turns},{2:half_turns}) {3};\n',
         self.theta, self.phi, self.lmda, qubits[0])