From a50ae658da2bb9a1c55cd5444091f525a2996f87 Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Tue, 31 Oct 2023 10:52:36 -0400 Subject: [PATCH] Add smoke test --- test/cutting/qpd/instructions/test_qpd_gate.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cutting/qpd/instructions/test_qpd_gate.py b/test/cutting/qpd/instructions/test_qpd_gate.py index 066e79a3e..65064ce03 100644 --- a/test/cutting/qpd/instructions/test_qpd_gate.py +++ b/test/cutting/qpd/instructions/test_qpd_gate.py @@ -13,9 +13,11 @@ import unittest import copy +import io import pytest -from qiskit.circuit.library.standard_gates import XGate, YGate, ZGate +from qiskit import QuantumCircuit, qpy +from qiskit.circuit.library.standard_gates import CXGate, XGate, YGate, ZGate from circuit_knitting.cutting.qpd import ( QPDBasis, @@ -102,3 +104,10 @@ def test_compare_1q_and_2q(self): # Call both eq methods, since single qubit implements a slightly different equivalence self.assertFalse(inst_2q == inst_1q) self.assertFalse(inst_1q == inst_2q) + + def test_qpy_serialization(self): + qc = QuantumCircuit(2) + qc.append(TwoQubitQPDGate.from_instruction(CXGate()), [0, 1]) + + f = io.BytesIO() + qpy.dump(qc, f)