Loading python/tests/test_kernel_jit.py +14 −1 Original line number Diff line number Diff line Loading @@ -107,5 +107,18 @@ class TestSimpleKernelJIT(unittest.TestCase): self.assertTrue('00' in counts) self.assertTrue('11' in counts) def test_exp_i_theta(self): @qjit def kernelExpVar(q : qreg, theta: float): exponent_op = X(0) * Y(1) - Y(0) * X(1) exp_i_theta(q, theta, exponent_op) # Allocate 2 qubits q = qalloc(2) theta = 1.234 # Validate exp_i_theta expansion comp = kernelExpVar.extract_composite(q, theta) self.assertEqual(comp.nInstructions(), 14) if __name__ == '__main__': unittest.main() No newline at end of file Loading
python/tests/test_kernel_jit.py +14 −1 Original line number Diff line number Diff line Loading @@ -107,5 +107,18 @@ class TestSimpleKernelJIT(unittest.TestCase): self.assertTrue('00' in counts) self.assertTrue('11' in counts) def test_exp_i_theta(self): @qjit def kernelExpVar(q : qreg, theta: float): exponent_op = X(0) * Y(1) - Y(0) * X(1) exp_i_theta(q, theta, exponent_op) # Allocate 2 qubits q = qalloc(2) theta = 1.234 # Validate exp_i_theta expansion comp = kernelExpVar.extract_composite(q, theta) self.assertEqual(comp.nInstructions(), 14) if __name__ == '__main__': unittest.main() No newline at end of file