コード例 #1
0
    def test_update_with_parameters(self):
        durations = InstructionDurations(
            [("rzx", (0, 1), 150, (0.5,)), ("rzx", (0, 1), 300, (1.0,))]
        )

        self.assertEqual(durations.get("rzx", [0, 1], parameters=[0.5]), 150)
        self.assertEqual(durations.get("rzx", [0, 1], parameters=[1.0]), 300)
コード例 #2
0
 def test_empty(self):
     durations = InstructionDurations()
     self.assertEqual(durations.dt, None)
     with self.assertRaises(TranspilerError):
         durations.get('cx', [0, 1], 'dt')