Exemplo n.º 1
0
    def compile_gates(self):
        errors = self.errors
        ideal_gates = self.ideal_gates

        noisy_gates = []

        for ideal_gate in ideal_gates:
            compiled_gate = compile_gate(ideal_gate, errors)

            # Synthesized gate
            if type(compiled_gate) == tuple:
                for noisy_gate in compiled_gate:
                    noisy_gates.append(noisy_gate)

            # Native gate
            else:
                noisy_gates.append(compiled_gate)

        self.noisy_gates = noisy_gates
Exemplo n.º 2
0
 def CNOT(self, q1, q2):
     return compile_gate(["CNOT", [q1, q2], None, None], self.errors, self.synth_Z)
Exemplo n.º 3
0
 def H(self, q):
     return compile_gate(["H", q, None, None], self.errors, self.synth_Z)
Exemplo n.º 4
0
 def XX(self, q1, q2, t):
     return compile_gate(["XX", [q1, q2], t, None], self.errors, self.synth_Z)
Exemplo n.º 5
0
 def Z(self, q, t):
     return compile_gate(["Z", q, t, None], self.errors, self.synth_Z)
Exemplo n.º 6
0
 def S_phi(self, q, theta, phi):
     return compile_gate(["S_phi", q, theta, phi], self.errors, self.synth_Z)