pub struct IBMQuantumClient { /* private fields */ }Expand description
Client for interacting with IBM Quantum
Implementations§
Source§impl IBMQuantumClient
impl IBMQuantumClient
Sourcepub fn new(token: &str) -> DeviceResult<Self>
pub fn new(token: &str) -> DeviceResult<Self>
Create a new IBM Quantum client with the given access token (legacy method)
Note: This method does not support automatic token refresh.
For production use, prefer new_with_api_key which supports auto-refresh.
Sourcepub async fn new_with_api_key(api_key: &str) -> DeviceResult<Self>
pub async fn new_with_api_key(api_key: &str) -> DeviceResult<Self>
Create a new IBM Quantum client with an API key
This method exchanges the API key for an access token and supports automatic token refresh when the token expires.
Sourcepub async fn new_with_config(config: IBMAuthConfig) -> DeviceResult<Self>
pub async fn new_with_config(config: IBMAuthConfig) -> DeviceResult<Self>
Create a new IBM Quantum client with full authentication configuration
Sourcepub async fn new_with_config_and_retry(
config: IBMAuthConfig,
retry_config: IBMRetryConfig,
) -> DeviceResult<Self>
pub async fn new_with_config_and_retry( config: IBMAuthConfig, retry_config: IBMRetryConfig, ) -> DeviceResult<Self>
Create a new IBM Quantum client with authentication and retry configuration
Sourcepub const fn set_retry_config(&mut self, config: IBMRetryConfig)
pub const fn set_retry_config(&mut self, config: IBMRetryConfig)
Set retry configuration
Sourcepub const fn retry_config(&self) -> &IBMRetryConfig
pub const fn retry_config(&self) -> &IBMRetryConfig
Get current retry configuration
Sourcepub async fn refresh_token(&self) -> DeviceResult<()>
pub async fn refresh_token(&self) -> DeviceResult<()>
Refresh the access token if it’s expired or about to expire
Sourcepub async fn is_token_valid(&self) -> bool
pub async fn is_token_valid(&self) -> bool
Check if the current token is valid
Sourcepub async fn token_info(&self) -> TokenInfo
pub async fn token_info(&self) -> TokenInfo
Get token expiration information
Sourcepub async fn list_backends_with_retry(&self) -> DeviceResult<Vec<IBMBackend>>
pub async fn list_backends_with_retry(&self) -> DeviceResult<Vec<IBMBackend>>
List all available backends with automatic retry
Sourcepub async fn list_backends(&self) -> DeviceResult<Vec<IBMBackend>>
pub async fn list_backends(&self) -> DeviceResult<Vec<IBMBackend>>
List all available backends
Sourcepub async fn get_backend(&self, backend_name: &str) -> DeviceResult<IBMBackend>
pub async fn get_backend(&self, backend_name: &str) -> DeviceResult<IBMBackend>
Get details about a specific backend
Sourcepub async fn submit_circuit(
&self,
backend_name: &str,
config: IBMCircuitConfig,
) -> DeviceResult<String>
pub async fn submit_circuit( &self, backend_name: &str, config: IBMCircuitConfig, ) -> DeviceResult<String>
Submit a circuit to be executed on an IBM Quantum backend
Sourcepub async fn get_job_status(&self, job_id: &str) -> DeviceResult<IBMJobStatus>
pub async fn get_job_status(&self, job_id: &str) -> DeviceResult<IBMJobStatus>
Get the status of a job
Sourcepub async fn get_job_result(&self, job_id: &str) -> DeviceResult<IBMJobResult>
pub async fn get_job_result(&self, job_id: &str) -> DeviceResult<IBMJobResult>
Get the results of a completed job
Sourcepub async fn wait_for_job(
&self,
job_id: &str,
timeout_secs: Option<u64>,
) -> DeviceResult<IBMJobResult>
pub async fn wait_for_job( &self, job_id: &str, timeout_secs: Option<u64>, ) -> DeviceResult<IBMJobResult>
Wait for a job to complete with timeout
Sourcepub async fn submit_circuits_parallel(
&self,
backend_name: &str,
configs: Vec<IBMCircuitConfig>,
) -> DeviceResult<Vec<String>>
pub async fn submit_circuits_parallel( &self, backend_name: &str, configs: Vec<IBMCircuitConfig>, ) -> DeviceResult<Vec<String>>
Submit multiple circuits in parallel
Sourcepub fn circuit_to_qasm<const N: usize>(
_circuit: &Circuit<N>,
_initial_layout: Option<HashMap<String, usize>>,
) -> DeviceResult<String>
pub fn circuit_to_qasm<const N: usize>( _circuit: &Circuit<N>, _initial_layout: Option<HashMap<String, usize>>, ) -> DeviceResult<String>
Convert a Quantrs circuit to QASM
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IBMQuantumClient
impl !RefUnwindSafe for IBMQuantumClient
impl Send for IBMQuantumClient
impl Sync for IBMQuantumClient
impl Unpin for IBMQuantumClient
impl !UnwindSafe for IBMQuantumClient
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
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.