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

Cudaq <> Superstaq integration #2423

Merged
merged 44 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
16d3fad
poc infleqtion server files
bharat-thotakura Nov 25, 2024
69818f0
c++ existing tests links for server
bharat-thotakura Nov 25, 2024
8d4fe3b
add new directory
bharat-thotakura Nov 25, 2024
0e8dfe6
some debug prints in c++ tests
bharat-thotakura Nov 25, 2024
d812916
draft mock qpu sketch
bharat-thotakura Nov 25, 2024
fcb33cf
add license header
bharat-thotakura Nov 25, 2024
bc10bec
Add infleqtion python test with mockserver
vtomole Nov 25, 2024
285720c
fix merge conflict
vtomole Nov 26, 2024
6f444dd
Ready to built testing wheel
vtomole Nov 26, 2024
7f3f673
Merge branch 'NVIDIA:main' into testing-server
vtomole Nov 26, 2024
64463c1
Revert testIonQ
vtomole Nov 26, 2024
68e02c7
Merge branch 'testing-server' of github.com:bharat-thotakura/cuda-qua…
vtomole Nov 26, 2024
ad36074
More reversions
vtomole Nov 26, 2024
832100a
DCO Remediation Commit for vtomole <[email protected]>
vtomole Nov 26, 2024
f7d8435
Run clang formatter
vtomole Nov 27, 2024
b0aa9c1
Format with yapf
vtomole Nov 27, 2024
2f35823
Run yapf with Google style
vtomole Nov 27, 2024
4995726
add newline at end of some new files
bharat-thotakura Nov 27, 2024
846df29
remove debug bell test
bharat-thotakura Nov 27, 2024
3a5bb09
Merge branch 'main' into testing-server
bharat-thotakura Nov 27, 2024
900fe75
Merge branch 'main' into testing-server
vtomole Nov 27, 2024
ec0d78c
Merge branch 'main' into testing-server
bharat-thotakura Nov 27, 2024
4bc6fb1
Update infleqtion.yml
vtomole Nov 28, 2024
99b7086
Merge branch 'testing-server' of github.com:bharat-thotakura/cuda-qua…
vtomole Nov 28, 2024
3d1802a
* Fix a typo in cmake
khalatepradnya Dec 2, 2024
aa8bd65
Merge branch 'main' into testing-server
khalatepradnya Dec 4, 2024
66e1813
some review responses + updates
bharat-thotakura Dec 5, 2024
65dc65a
fix: commit format
bharat-thotakura Dec 5, 2024
3621aeb
Merge branch 'main' into testing-server
khalatepradnya Dec 5, 2024
eda0882
Merge branch 'main' into testing-server
khalatepradnya Dec 5, 2024
ea7d179
* Test dor all gates, modifiers
khalatepradnya Dec 6, 2024
f12c620
* Skip the `observe` tests on C++ since the mock server returns
khalatepradnya Dec 6, 2024
12d1f75
Merge pull request #2 from khalatepradnya/infleqtion-updates
bharat-thotakura Dec 6, 2024
0d4e131
Merge branch 'main' into testing-server
bharat-thotakura Dec 6, 2024
511d502
* Updated C++ tests
khalatepradnya Dec 6, 2024
a31833d
Merge branch 'main' into testing-server
khalatepradnya Dec 6, 2024
2806714
* Fix symbolic links
khalatepradnya Dec 7, 2024
a27c1d3
update backend name
bharat-thotakura Dec 7, 2024
0988d0e
remove unused shots assignment
bharat-thotakura Dec 7, 2024
8cc2d14
override polling seconds and error for canceled job
bharat-thotakura Dec 7, 2024
0d8ee7d
Merge branch 'main' into testing-server
khalatepradnya Dec 9, 2024
8057f55
* Additional tests for multiple qvectors and multiple measurements
khalatepradnya Dec 9, 2024
f265276
Merge branch 'main' into testing-server
khalatepradnya Dec 9, 2024
d987b5c
Merge branch 'main' into testing-server
bettinaheim Dec 10, 2024
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
60 changes: 60 additions & 0 deletions python/tests/backends/test_Infleqtion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ============================================================================ #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #

import cudaq, pytest, os
from cudaq import spin
import numpy as np
from typing import List
from multiprocessing import Process
from network_utils import check_server_connection
try:
from utils.mock_qpu.infleqtion import startServer
except:
print("Mock qpu not available, skipping Infleqtion tests.")
pytest.skip("Mock qpu not available.", allow_module_level=True)

# Define the port for the mock server
port = 62441

@pytest.fixture(scope="session", autouse=True)
def startUpMockServer():
os.environ["SUPERSTAQ_API_KEY"] = "00000000000000000000000000000000"

# Set the targeted QPU
cudaq.set_target("infleqtion", url="http://localhost:{}".format(port))

# Launch the Mock Server
p = Process(target=startServer, args=(port,))
p.start()

if not check_server_connection(port):
p.terminate()
pytest.exit("Mock server did not start in time, skipping tests.",
returncode=1)

yield "Server started."

# Kill the server
p.terminate()

@cudaq.kernel
def kernel():
qubit = cudaq.qubit()
h(qubit)
x(qubit)
y(qubit)
z(qubit)
t(qubit)
s(qubit)
mz(qubit)

def test_infleqtion_sample():
counts = cudaq.sample(kernel)
assert len(counts) == 2
assert "00" in counts
assert "11" in counts
1 change: 1 addition & 0 deletions runtime/cudaq/platform/default/rest/helpers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ add_subdirectory(oqc)
add_subdirectory(ionq)
add_subdirectory(quantinuum)
add_subdirectory(iqm)
add_subdirectory(infleqtion)
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ============================================================================ #
# Copyright (c) 2022 - 2024 NVIDIA Corporation & Affiliates. #
# All rights reserved. #
# #
# This source code and the accompanying materials are made available under #
# the terms of the Apache License 2.0 which accompanies this distribution. #
# ============================================================================ #
target_sources(cudaq-rest-qpu PRIVATE InfleqtionServerHelper.cpp)
add_target_config(infleqtion)

add_library(cudaq-serverhelper-infleqtion SHARED InfleqtionServerHelper.cpp )
target_link_libraries(cudaq-serverhelper-infleqtion
PUBLIC
cudaq-common
fmt::fmt-header-only
)
install(TARGETS cudaq-serverhelper-infleqtion DESTINATION lib)
Loading