Beispiel #1
0
    def get_qasm(self, var_parameters):
        assert len(var_parameters) == 1
        parameter_1 = var_parameters[0]

        qasm = QasmUtils.d_q_exc_qasm(parameter_1, self.qubits[0],
                                      self.qubits[1])

        if [set(self.qubits[0]), set(self.qubits[1])] != [set(self.complement_qubits[0]), set(self.complement_qubits[1])] and \
           [set(self.qubits[0]), set(self.qubits[1])] != [set(self.complement_qubits[1]), set(self.complement_qubits[0])]:

            qasm += QasmUtils.d_q_exc_qasm(self.sign * parameter_1,
                                           self.complement_qubits[0],
                                           self.complement_qubits[1])

        return qasm
Beispiel #2
0
    def get_qasm(self, var_parameters):
        assert len(var_parameters) == 1
        parameter = var_parameters[0]

        return QasmUtils.d_q_exc_qasm(parameter, self.qubits[0],
                                      self.qubits[1])