Example #1
0
 def test(self, circuit, level):
     """All the levels with all the 1Q backend"""
     with self.assertRaises(TranspilerError):
         transpile(circuit(),
                   backend=Fake1Q(),
                   optimization_level=level,
                   seed_transpiler=42)
Example #2
0
 def test(self, circuit, level):
     """All the levels with all the 1Q backend"""
     result = transpile(circuit(),
                        backend=Fake1Q(),
                        optimization_level=level,
                        seed_transpiler=42)
     self.assertIsInstance(result, QuantumCircuit)
Example #3
0
 def test_simulator(self, circuit, level):
     """All the levels with all the 1Q simulator backend"""
     # Set fake backend config to simulator
     backend = Fake1Q()
     backend._configuration.simulator = True
     result = transpile(circuit(),
                        backend=backend,
                        optimization_level=level,
                        seed_transpiler=42)
     self.assertIsInstance(result, QuantumCircuit)