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

Add Support for Local Websockets and IBM Quantum API #1766

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion qiskit_ibm_runtime/base_runtime_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ def __init__(
self._ws_client_future = None # type: Optional[futures.Future]
self._result_queue = queue.Queue() # type: queue.Queue
self._ws_client = RuntimeWebsocketClient(
websocket_url=client_params.get_runtime_api_base_url().replace("https", "wss"),
websocket_url=client_params.get_runtime_api_base_url()
.replace("https", "wss")
.replace("http", "ws"),
client_params=client_params,
job_id=job_id,
message_queue=self._result_queue,
Expand Down
11 changes: 10 additions & 1 deletion test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ def _get_integration_test_config():
os.getenv("QISKIT_IBM_INSTANCE"),
os.getenv("CHANNEL_STRATEGY"),
)
channel: Any = "ibm_quantum" if url.find("quantum-computing.ibm.com") >= 0 else "ibm_cloud"
channel = "ibm_cloud"
if url is None:
return channel, token, url, instance, channel_strategy

url_is_localhost = url.find("localhost") >= 0 or url.find("127.0.0.1") >= 0
url_is_ibm_quantum = (
url.find("quantum-computing.ibm.com") >= 0 or url.find("quantum.ibm.com") >= 0
)
if url_is_ibm_quantum or url_is_localhost:
channel = "ibm_quantum"
return channel, token, url, instance, channel_strategy


Expand Down