Skip to content

Commit 8e1cef1

Browse files
authored
feat: #554: Riverlane translation options (#553)
* feat: Riverlane translation options * for now, ignore PyO3 issue * add the Python & typestubs * warn, not error, on large return err variants * manually fix clippy style issues
1 parent 9ea945b commit 8e1cef1

File tree

13 files changed

+151
-124
lines changed

13 files changed

+151
-124
lines changed

Cargo.lock

Lines changed: 35 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ members = ["crates/*"]
33
resolver = "2"
44

55
[workspace.dependencies]
6-
qcs-api-client-common = "0.12.0"
7-
qcs-api-client-grpc = "0.12.0"
8-
qcs-api-client-openapi = "0.13.0"
6+
qcs-api-client-common = "0.12.5"
7+
qcs-api-client-grpc = "0.12.5"
8+
qcs-api-client-openapi = "0.13.5"
99
serde_json = "1.0.86"
1010
thiserror = "1.0.57"
1111
tokio = "1.36.0"

crates/lib/src/compiler/isa/qubit.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ impl Qubit {
4242
///
4343
/// # Arguments
4444
/// 1. `op_name`: The name of the operation defined on this Qubit. This comes from
45-
/// `instructions[n].name` in the QCS response.
45+
/// `instructions[n].name` in the QCS response.
4646
/// 2. `characteristics`: Data related to the operation at a this site (Qubit). Comes from
47-
/// `instructions[n].sites[m].characteristics` in the QCS response.
47+
/// `instructions[n].sites[m].characteristics` in the QCS response.
4848
/// 3. `benchmarks`: Top level benchmarks on the Qubits, comes from `benchmarks` in the QCS
49-
/// response.
49+
/// response.
5050
///
5151
/// # Errors
5252
/// 1. `randomized_benchmark_simultaneous_1q` was not present in `benchmarks`: this is necessary
53-
/// for RX and RZ gates.
53+
/// for RX and RZ gates.
5454
/// 2. An unknown `op_name` was provided.
5555
pub(crate) fn add_operation(
5656
&mut self,

crates/lib/src/executable.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'executable> Executable<'executable, '_> {
113113
/// # Arguments
114114
///
115115
/// 1. `quil` is a string slice representing the original program to be run. The returned
116-
/// [`Executable`] will only live as long as this reference.
116+
/// [`Executable`] will only live as long as this reference.
117117
#[must_use]
118118
#[allow(clippy::missing_panics_doc)]
119119
pub fn from_quil<Quil: Into<Arc<str>>>(quil: Quil) -> Self {
@@ -138,8 +138,8 @@ impl<'executable> Executable<'executable, '_> {
138138
/// # Arguments
139139
///
140140
/// 1. `register` is a string reference of the name of a register to read from. The lifetime
141-
/// of this reference should be the lifetime of the [`Executable`], which is the lifetime of
142-
/// the `quil` argument to [`Executable::from_quil`].
141+
/// of this reference should be the lifetime of the [`Executable`], which is the lifetime of
142+
/// the `quil` argument to [`Executable::from_quil`].
143143
///
144144
/// # Example
145145
///
@@ -212,8 +212,8 @@ impl<'executable> Executable<'executable, '_> {
212212
/// # Arguments
213213
///
214214
/// 1. `param_name`: Reference to the name of the parameter which should correspond to a
215-
/// `DECLARE` statement in the Quil program. The lifetime of the reference should be the
216-
/// same as the [`Executable`]: that is the same as the `quil` param to [`Executable::from_quil`].
215+
/// `DECLARE` statement in the Quil program. The lifetime of the reference should be the
216+
/// same as the [`Executable`]: that is the same as the `quil` param to [`Executable::from_quil`].
217217
/// 2. `index`: The index into the memory vector that you're setting.
218218
/// 3. `value`: The value to set for the specified memory.
219219
///
@@ -424,8 +424,8 @@ impl<'execution> Executable<'_, 'execution> {
424424
///
425425
/// # Arguments
426426
/// 1. `quantum_processor_id`: The name of the QPU to run on. This parameter affects the
427-
/// lifetime of the [`Executable`]. The [`Executable`] will only live as long as the last
428-
/// parameter passed into this function.
427+
/// lifetime of the [`Executable`]. The [`Executable`] will only live as long as the last
428+
/// parameter passed into this function.
429429
///
430430
/// # Warning
431431
///
@@ -465,13 +465,13 @@ impl<'execution> Executable<'_, 'execution> {
465465
///
466466
/// # Arguments
467467
/// 1. `quantum_processor_id`: The ID of the QPU for which to translate the program.
468-
/// This parameter affects the lifetime of the [`Executable`].
469-
/// The [`Executable`] will only live as long as the last parameter passed into this function.
468+
/// This parameter affects the lifetime of the [`Executable`].
469+
/// The [`Executable`] will only live as long as the last parameter passed into this function.
470470
/// 2. `translation_options`: An optional [`TranslationOptions`] that is used to configure how
471471
/// the program in translated.
472472
/// 3. `execution_options`: The [`ExecutionOptions`] to use. If the connection strategy used
473-
/// is [`crate::qpu::api::ConnectionStrategy::EndpointId`] then direct access to that endpoint
474-
/// overrides the `quantum_processor_id` parameter.
473+
/// is [`crate::qpu::api::ConnectionStrategy::EndpointId`] then direct access to that endpoint
474+
/// overrides the `quantum_processor_id` parameter.
475475
///
476476
/// # Warning
477477
///
@@ -523,13 +523,13 @@ impl<'execution> Executable<'_, 'execution> {
523523
///
524524
/// # Arguments
525525
/// 1. `quantum_processor_id`: The ID of the QPU for which to translate the program.
526-
/// This parameter affects the lifetime of the [`Executable`].
527-
/// The [`Executable`] will only live as long as the last parameter passed into this function.
526+
/// This parameter affects the lifetime of the [`Executable`].
527+
/// The [`Executable`] will only live as long as the last parameter passed into this function.
528528
/// 2. `translation_options`: An optional [`TranslationOptions`] that is used to configure how
529529
/// the program in translated.
530530
/// 3. `execution_options`: The [`ExecutionOptions`] to use. If the connection strategy used
531-
/// is [`crate::qpu::api::ConnectionStrategy::EndpointId`] then direct access to that endpoint
532-
/// overrides the `quantum_processor_id` parameter.
531+
/// is [`crate::qpu::api::ConnectionStrategy::EndpointId`] then direct access to that endpoint
532+
/// overrides the `quantum_processor_id` parameter.
533533
///
534534
/// # Errors
535535
///

crates/lib/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#![allow(clippy::missing_errors_doc)]
55
#![allow(clippy::implicit_hasher)]
66
#![allow(clippy::too_many_arguments)]
7+
#![warn(clippy::result_large_err)] // TODO #555: box the large variants or change the lint threshold
8+
#![warn(clippy::large_enum_variant)] // TODO #555: box the large variants
79
#![forbid(unsafe_code)]
810
#![warn(future_incompatible)]
911
#![warn(rust_2018_compatibility, rust_2018_idioms)]

0 commit comments

Comments
 (0)