Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove optional sympy imports #11662

Merged
merged 5 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions test/python/pulse/test_pulse_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import unittest
from unittest.mock import patch
import numpy as np
import symengine as sym

from qiskit.circuit import Parameter
from qiskit.pulse.library import (
Expand All @@ -41,11 +42,6 @@
from qiskit.test import QiskitTestCase
from qiskit.utils import optionals as _optional

if _optional.HAS_SYMENGINE:
import symengine as sym
else:
import sympy as sym


class TestWaveform(QiskitTestCase):
"""Waveform tests."""
Expand Down
5 changes: 1 addition & 4 deletions test/python/qpy/test_block_load_from_qpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from ddt import ddt, data, unpack

import numpy as np
import symengine as sym

from qiskit.pulse import builder, Schedule
from qiskit.pulse.library import (
Expand All @@ -43,10 +44,6 @@
from qiskit.pulse.configuration import Kernel, Discriminator


if _optional.HAS_SYMENGINE:
import symengine as sym
else:
import sympy as sym


class QpyScheduleTestCase(QiskitTestCase):
Expand Down
6 changes: 2 additions & 4 deletions test/qpy_compat/test_qpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,8 @@ def generate_schedule_blocks():
builder.acquire(1000, channels.AcquireChannel(0), channels.MemorySlot(0))
schedule_blocks.append(block)
# Raw symbolic pulse
if optionals.HAS_SYMENGINE:
import symengine as sym
else:
import sympy as sym
import symengine as sym

duration, amp, t = sym.symbols("duration amp t") # pylint: disable=invalid-name
expr = amp * sym.sin(2 * sym.pi * t / duration)
my_pulse = library.SymbolicPulse(
Expand Down
Loading