@@ -12,7 +12,7 @@ use qcs_api_client_openapi::models::InstructionSetArchitecture;
12
12
use super :: isa:: { self , Compiler } ;
13
13
use super :: rpcq;
14
14
15
- use crate :: qpu :: client:: Qcs ;
15
+ use crate :: client:: Qcs ;
16
16
17
17
/// Number of seconds to wait before timing out.
18
18
pub const DEFAULT_COMPILER_TIMEOUT : f64 = 30.0 ;
@@ -47,8 +47,7 @@ pub fn compile_program(
47
47
#[ cfg( feature = "tracing" ) ]
48
48
tracing:: debug!( compiler_options=?options, "compiling quil program with quilc" , ) ;
49
49
50
- let config = client. get_config ( ) ;
51
- let endpoint = config. quilc_url ( ) ;
50
+ let endpoint = client. get_config ( ) . quilc_url ( ) ;
52
51
let params = QuilcParams :: new ( quil, isa) . with_protoquil ( options. protoquil ) ;
53
52
let request =
54
53
rpcq:: RPCRequest :: new ( "quil_to_native_quil" , & params) . with_timeout ( options. timeout ) ;
@@ -428,7 +427,7 @@ mod tests {
428
427
let output = compile_program (
429
428
"MEASURE 0" ,
430
429
TargetDevice :: try_from ( qvm_isa ( ) ) . expect ( "Couldn't build target device from ISA" ) ,
431
- & Qcs :: load ( ) . await . unwrap_or_default ( ) ,
430
+ & Qcs :: load ( ) . await ,
432
431
CompilerOpts :: default ( ) ,
433
432
)
434
433
. expect ( "Could not compile" ) ;
@@ -446,7 +445,7 @@ MEASURE 1 ro[1]
446
445
447
446
#[ tokio:: test]
448
447
async fn run_compiled_bell_state_on_qvm ( ) {
449
- let client = Qcs :: load ( ) . await . unwrap_or_default ( ) ;
448
+ let client = Qcs :: load ( ) . await ;
450
449
let output = compile_program (
451
450
BELL_STATE ,
452
451
TargetDevice :: try_from ( aspen_9_isa ( ) ) . expect ( "Couldn't build target device from ISA" ) ,
@@ -456,12 +455,7 @@ MEASURE 1 ro[1]
456
455
. expect ( "Could not compile" ) ;
457
456
let mut results = crate :: qvm:: Execution :: new ( & output. program . to_string ( true ) )
458
457
. unwrap ( )
459
- . run (
460
- 10 ,
461
- & [ Cow :: Borrowed ( "ro" ) ] ,
462
- & HashMap :: default ( ) ,
463
- & client. get_config ( ) ,
464
- )
458
+ . run ( 10 , & [ Cow :: Borrowed ( "ro" ) ] , & HashMap :: default ( ) , & client)
465
459
. await
466
460
. expect ( "Could not run program on QVM" ) ;
467
461
for shot in results
@@ -478,7 +472,7 @@ MEASURE 1 ro[1]
478
472
479
473
#[ tokio:: test]
480
474
async fn test_compile_declare_only ( ) {
481
- let client = Qcs :: load ( ) . await . unwrap_or_default ( ) ;
475
+ let client = Qcs :: load ( ) . await ;
482
476
let output = compile_program (
483
477
"DECLARE ro BIT[1]\n " ,
484
478
TargetDevice :: try_from ( aspen_9_isa ( ) ) . expect ( "Couldn't build target device from ISA" ) ,
@@ -492,15 +486,15 @@ MEASURE 1 ro[1]
492
486
493
487
#[ tokio:: test]
494
488
async fn get_version_info_from_quilc ( ) {
495
- let client = Qcs :: load ( ) . await . unwrap_or_default ( ) ;
489
+ let client = Qcs :: load ( ) . await ;
496
490
let version = get_version_info ( & client) . expect ( "Should get version info from quilc" ) ;
497
491
let semver_re = Regex :: new ( r"^([0-9]+)\.([0-9]+)\.([0-9]+)$" ) . unwrap ( ) ;
498
492
assert ! ( semver_re. is_match( & version) ) ;
499
493
}
500
494
501
495
#[ tokio:: test]
502
496
async fn test_conjugate_pauli_by_clifford ( ) {
503
- let client = Qcs :: load ( ) . await . unwrap_or_default ( ) ;
497
+ let client = Qcs :: load ( ) . await ;
504
498
let request = ConjugateByCliffordRequest {
505
499
pauli : PauliTerm {
506
500
indices : vec ! [ 0 ] ,
@@ -522,7 +516,7 @@ MEASURE 1 ro[1]
522
516
523
517
#[ tokio:: test]
524
518
async fn test_generate_randomized_benchmark_sequence ( ) {
525
- let client = Qcs :: load ( ) . await . unwrap_or_default ( ) ;
519
+ let client = Qcs :: load ( ) . await ;
526
520
let request = RandomizedBenchmarkingRequest {
527
521
depth : 2 ,
528
522
qubits : 1 ,
0 commit comments