pub struct PhotonicClient {
pub base_url: String,
pub auth_token: String,
pub client: Client,
pub timeout: Duration,
pub headers: HashMap<String, String>,
}Expand description
Client for photonic quantum computing systems
Fields§
§base_url: StringBase URL for the photonic service
auth_token: StringAuthentication token
client: ClientHTTP client for API requests
timeout: DurationRequest timeout
headers: HashMap<String, String>Additional headers for requests
Implementations§
Source§impl PhotonicClient
impl PhotonicClient
Sourcepub fn new(base_url: String, auth_token: String) -> DeviceResult<Self>
pub fn new(base_url: String, auth_token: String) -> DeviceResult<Self>
Create a new photonic client
Sourcepub fn with_config(
base_url: String,
auth_token: String,
timeout_secs: u64,
headers: HashMap<String, String>,
) -> DeviceResult<Self>
pub fn with_config( base_url: String, auth_token: String, timeout_secs: u64, headers: HashMap<String, String>, ) -> DeviceResult<Self>
Create a new photonic client with custom configuration
Sourcepub async fn get_devices(&self) -> DeviceResult<Vec<PhotonicDeviceInfo>>
pub async fn get_devices(&self) -> DeviceResult<Vec<PhotonicDeviceInfo>>
Get available photonic devices
Sourcepub async fn get_device(
&self,
device_id: &str,
) -> DeviceResult<PhotonicDeviceInfo>
pub async fn get_device( &self, device_id: &str, ) -> DeviceResult<PhotonicDeviceInfo>
Get device information by ID
Sourcepub async fn submit_job(
&self,
job_request: &PhotonicJobRequest,
) -> DeviceResult<String>
pub async fn submit_job( &self, job_request: &PhotonicJobRequest, ) -> DeviceResult<String>
Submit a job to a photonic device
Sourcepub async fn get_job_status(
&self,
job_id: &str,
) -> DeviceResult<PhotonicJobStatus>
pub async fn get_job_status( &self, job_id: &str, ) -> DeviceResult<PhotonicJobStatus>
Get job status
Sourcepub async fn get_job_results(
&self,
job_id: &str,
) -> DeviceResult<PhotonicJobResult>
pub async fn get_job_results( &self, job_id: &str, ) -> DeviceResult<PhotonicJobResult>
Get job results
Sourcepub async fn cancel_job(&self, job_id: &str) -> DeviceResult<()>
pub async fn cancel_job(&self, job_id: &str) -> DeviceResult<()>
Cancel a job
Sourcepub async fn measure_quadratures(
&self,
device_id: &str,
modes: &[usize],
phases: &[f64],
) -> DeviceResult<Vec<(f64, f64)>>
pub async fn measure_quadratures( &self, device_id: &str, modes: &[usize], phases: &[f64], ) -> DeviceResult<Vec<(f64, f64)>>
Perform quadrature measurement
Sourcepub async fn measure_photon_numbers(
&self,
device_id: &str,
modes: &[usize],
) -> DeviceResult<Vec<usize>>
pub async fn measure_photon_numbers( &self, device_id: &str, modes: &[usize], ) -> DeviceResult<Vec<usize>>
Perform photon number measurement
Sourcepub async fn homodyne_detection(
&self,
device_id: &str,
mode: usize,
phase: f64,
shots: usize,
) -> DeviceResult<Vec<f64>>
pub async fn homodyne_detection( &self, device_id: &str, mode: usize, phase: f64, shots: usize, ) -> DeviceResult<Vec<f64>>
Perform homodyne detection
Sourcepub async fn heterodyne_detection(
&self,
device_id: &str,
mode: usize,
shots: usize,
) -> DeviceResult<Vec<(f64, f64)>>
pub async fn heterodyne_detection( &self, device_id: &str, mode: usize, shots: usize, ) -> DeviceResult<Vec<(f64, f64)>>
Perform heterodyne detection
Sourcepub async fn check_availability(&self) -> DeviceResult<bool>
pub async fn check_availability(&self) -> DeviceResult<bool>
Check device availability
Sourcepub async fn is_simulator(&self) -> DeviceResult<bool>
pub async fn is_simulator(&self) -> DeviceResult<bool>
Check if this is a simulator
Sourcepub async fn get_queue_time(&self) -> DeviceResult<Duration>
pub async fn get_queue_time(&self) -> DeviceResult<Duration>
Get queue time estimate
Sourcepub async fn execute_photonic_circuit(
&self,
circuit: &str,
shots: usize,
config: &HashMap<String, Value>,
) -> DeviceResult<PhotonicJobResult>
pub async fn execute_photonic_circuit( &self, circuit: &str, shots: usize, config: &HashMap<String, Value>, ) -> DeviceResult<PhotonicJobResult>
Execute a photonic circuit
Sourcepub async fn calculate_correlations(
&self,
modes: &[(usize, usize)],
correlation_type: &str,
) -> DeviceResult<HashMap<String, f64>>
pub async fn calculate_correlations( &self, modes: &[(usize, usize)], correlation_type: &str, ) -> DeviceResult<HashMap<String, f64>>
Calculate quantum correlations between modes
Sourcepub async fn estimate_fidelity(
&self,
target_state: &str,
measurement_data: &PhotonicMeasurementData,
) -> DeviceResult<f64>
pub async fn estimate_fidelity( &self, target_state: &str, measurement_data: &PhotonicMeasurementData, ) -> DeviceResult<f64>
Estimate state fidelity
Trait Implementations§
Source§impl Clone for PhotonicClient
impl Clone for PhotonicClient
Source§fn clone(&self) -> PhotonicClient
fn clone(&self) -> PhotonicClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PhotonicClient
impl !RefUnwindSafe for PhotonicClient
impl Send for PhotonicClient
impl Sync for PhotonicClient
impl Unpin for PhotonicClient
impl !UnwindSafe for PhotonicClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.