From 9cd0b9865b90e3f9067f7571b7820289e93a0ec7 Mon Sep 17 00:00:00 2001 From: Wikstahl Date: Wed, 15 Jun 2022 16:49:57 +0200 Subject: [PATCH 1/3] lets _fill_coeff handle complex coefficients --- src/qutip_qip/pulse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qutip_qip/pulse.py b/src/qutip_qip/pulse.py index 5ec95959..bac9db1c 100644 --- a/src/qutip_qip/pulse.py +++ b/src/qutip_qip/pulse.py @@ -631,7 +631,7 @@ def _fill_coeff(old_coeffs, old_tlist, full_tlist, args=None, tol=1.0e-10): old_coeffs = np.concatenate([old_coeffs, [0]]) new_n = len(full_tlist) old_ind = 0 # index for old coeffs and tlist - new_coeff = np.zeros(new_n) + new_coeff = np.zeros(new_n, dtype=np.complex128) for new_ind in range(new_n): t = full_tlist[new_ind] if old_tlist[0] - t > tol: From 4c72680feed2366c15eab4bf10869f62a730cd60 Mon Sep 17 00:00:00 2001 From: Boxi Li Date: Tue, 14 Mar 2023 22:22:00 +0100 Subject: [PATCH 2/3] Install qutip-qtrl in the test action for qutip5 --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5004144..247c7569 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,12 @@ jobs: python -m pip install numpy scipy cython python -m pip install 'git+https://github.com/qutip/qutip.git${{ matrix.qutip-version }}' + # For qutip-v5 qutip.control is replaced by qutip-qtrl + - name: Install qutip-qtrl from PyPI + if: ${{ matrix.qutip-version == '@master'}} + run: | + python -m pip install qutip-qtrl + - name: Install Qiskit from PyPI if: ${{ matrix.qiskit-version != '' }} run: python -m pip install 'qiskit${{ matrix.qiskit-version }}' From 0e10089f80615199a6129ec84b7ece73ae677647 Mon Sep 17 00:00:00 2001 From: Boxi Li Date: Tue, 14 Mar 2023 23:05:28 +0100 Subject: [PATCH 3/3] Let the pulse coeff use the existing dtype --- src/qutip_qip/pulse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qutip_qip/pulse.py b/src/qutip_qip/pulse.py index c820f42f..1bd709cf 100644 --- a/src/qutip_qip/pulse.py +++ b/src/qutip_qip/pulse.py @@ -652,7 +652,7 @@ def _fill_coeff(old_coeffs, old_tlist, full_tlist, args=None, tol=1.0e-10): old_coeffs = np.concatenate([old_coeffs, [0]]) new_n = len(full_tlist) old_ind = 0 # index for old coeffs and tlist - new_coeff = np.zeros(new_n, dtype=np.complex128) + new_coeff = np.zeros(new_n, dtype=old_coeffs.dtype) for new_ind in range(new_n): t = full_tlist[new_ind] if old_tlist[0] - t > tol: