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

feat!: Make Python bindings public #463

Merged
merged 29 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
471bae3
wip: various publicity modifications and refactors
MarquessV Apr 18, 2024
3d3a4d7
Merge branch 'main' into 451-make-python-bindings-public
MarquessV Apr 18, 2024
f83ec80
Merge branch 'main' into 451-make-python-bindings-public
MarquessV Jul 12, 2024
939318f
derive debug on PyTranslationOptions
MarquessV Jul 12, 2024
42f12b2
add utility method for converting TranslationOptions into protobuf bytes
MarquessV Jul 17, 2024
478d68d
add methods for inspecting a PyConnectionStrategy
MarquessV Jul 17, 2024
2b4061b
update qcs dependencies
MarquessV Jul 18, 2024
cf0f95e
update rigetti-pyo3
MarquessV Jul 18, 2024
0a64f8d
Merge main, remove unused async
MarquessV Aug 27, 2024
39ef7b6
update Cargo.lock
MarquessV Aug 27, 2024
2ef36aa
replace py_sync module w/ rigetti-pyo3
MarquessV Aug 27, 2024
497d851
Apply suggestions from code review
MarquessV Aug 27, 2024
1003b40
update qcs-api-client-grpc
MarquessV Aug 27, 2024
f90eaa6
remove stale TODO
MarquessV Aug 27, 2024
7e0a5b7
reduce visibility of gRPC message size constant
MarquessV Aug 27, 2024
b23ec8b
update qcs-api-cilent packages, use uv instead of poetry
MarquessV Aug 30, 2024
33ebd8f
activate virtual environment
MarquessV Aug 30, 2024
b42ebcb
commit the change
MarquessV Aug 30, 2024
3b55aaf
activate venv
MarquessV Aug 30, 2024
a04c1a3
separate steps?
MarquessV Aug 30, 2024
caaabc4
write to GITHUB_ENV
MarquessV Aug 30, 2024
4c33b1b
try cat
MarquessV Aug 30, 2024
d1cdc85
try action
MarquessV Aug 30, 2024
db19606
remove duplicated command
MarquessV Aug 30, 2024
846f7aa
add missing dev dep
MarquessV Sep 14, 2024
53c03e0
Update qcs-api-client-rust packages
MarquessV Sep 16, 2024
b4cf81a
Merge branch 'main' into 451-make-python-bindings-public
MarquessV Sep 16, 2024
5c075da
update quil-rs
MarquessV Sep 16, 2024
80069b1
update type stubs
MarquessV Sep 16, 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
5 changes: 1 addition & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,18 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: '3.20.1'

- name: Install libquil dependencies
run: sudo apt install -y libffi\* libblas\* liblapack\*
- name: Install libquil
run: |
curl https://raw.githubusercontent.com/rigetti/libquil/main/install.sh | bash -s 0.3.0

- uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Install poetry
uses: snok/install-poetry@v1
- uses: syphar/restore-virtualenv@v1
# may protect against linking failure: no space left on device
- name: Delete huge unnecessary tools folder
run: rm -rf /opt/hostedtoolcache
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install poetry
uses: snok/install-poetry@v1
- uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- uses: syphar/restore-virtualenv@v1
- name: Build qcs-sdk-python documentation
uses: actions-rs/cargo@v1
with:
Expand Down
84 changes: 57 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ resolver = "2"

[workspace.dependencies]
qcs-api = "0.2.1"
qcs-api-client-common = "0.8.4"
qcs-api-client-grpc = "0.8.4"
qcs-api-client-openapi = "0.9.4"
qcs-api-client-common = "0.10.0"
qcs-api-client-grpc = "0.10.0"
qcs-api-client-openapi = "0.11.0"
serde_json = "1.0.86"
thiserror = "1.0.57"
tokio = "1.36.0"
# We specify quil-rs as a git and versioned dependency so that we can keep the version of
# quil-rs used in both the Rust and Python packages in sync. The tag used should always
# be a `quil-py` tag and should be comaptible with the version specified in
# be a `quil-py` tag and should be compatible with the version specified in
# `crates/python/pyproject.toml`.
# The version must also be specified in order to publish to crates.io. Cargo enforces
# that the specified version is the same as the version in the git repository.
quil-rs = { version = "0.27.1", git = "https://github.com/rigetti/quil-rs", tag = "quil-py/v0.11.1" }
quil-rs = { version = "0.28.1", git = "https://github.com/rigetti/quil-rs", tag = "quil-py/v0.12.1" }

# ndarray is used by the `qcs` crate, but it is also used in the `python` crate via a
# re-export through the numpy crate. They should be updated as a pair to keep both
Expand All @@ -32,7 +32,7 @@ pyo3-opentelemetry = { version = "=0.3.2-dev.1" }
pyo3-tracing-subscriber = { version = "=0.1.2-dev.1", default-features = true }

pyo3-build-config = "0.20.0"
rigetti-pyo3 = { version = "0.3.1", default-features = false, features = ["time", "complex"] }
rigetti-pyo3 = { version = "0.4.1", default-features = false, features = ["complex", "time"] }

# The primary intent of these options is to reduce the binary size for Python wheels
# since PyPi has limits on how much storage a project can use.
Expand Down
11 changes: 4 additions & 7 deletions crates/lib/src/compiler/quilc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ mod tests {
serde_json::from_reader(File::open("tests/qvm_isa.json").unwrap()).unwrap()
}

async fn rpcq_client() -> rpcq::Client {
fn rpcq_client() -> rpcq::Client {
let qcs = Qcs::load();
let endpoint = qcs.get_config().quilc_url();
rpcq::Client::new(endpoint).unwrap()
Expand All @@ -366,7 +366,6 @@ mod tests {
#[tokio::test]
async fn compare_native_quil_to_expected_output() {
let output = rpcq_client()
.await
.compile_program(
"MEASURE 0",
TargetDevice::try_from(qvm_isa()).expect("Couldn't build target device from ISA"),
Expand All @@ -390,7 +389,6 @@ MEASURE 1 ro[1]
let client = Qcs::load();
let client = qvm::http::HttpClient::from(&client);
let output = rpcq_client()
.await
.compile_program(
BELL_STATE,
TargetDevice::try_from(aspen_9_isa())
Expand Down Expand Up @@ -426,7 +424,6 @@ MEASURE 1 ro[1]
#[tokio::test]
async fn test_compile_declare_only() {
let output = rpcq_client()
.await
.compile_program(
"DECLARE ro BIT[1]\n",
TargetDevice::try_from(aspen_9_isa())
Expand All @@ -440,7 +437,7 @@ MEASURE 1 ro[1]

#[tokio::test]
async fn get_version_info_from_quilc() {
let rpcq_client = rpcq_client().await;
let rpcq_client = rpcq_client();
let version = rpcq_client
.get_version_info()
.expect("Should get version info from quilc");
Expand All @@ -450,7 +447,7 @@ MEASURE 1 ro[1]

#[tokio::test]
async fn test_conjugate_pauli_by_clifford() {
let rpcq_client = rpcq_client().await;
let rpcq_client = rpcq_client();
let request = ConjugateByCliffordRequest {
pauli: PauliTerm {
indices: vec![0],
Expand All @@ -473,7 +470,7 @@ MEASURE 1 ro[1]

#[tokio::test]
async fn test_generate_randomized_benchmark_sequence() {
let rpcq_client = rpcq_client().await;
let rpcq_client = rpcq_client();
let request = RandomizedBenchmarkingRequest {
depth: 2,
qubits: 1,
Expand Down
Loading
Loading