cirq_google.cloud.quantum.QuantumEngineServiceAsyncClient

-

credentials Optional[google.auth.credentials.Credentials]

The authorization credentials to attach to requests. These credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. transport ( Optional[ str | QuantumEngineServiceTransport | Callable[..., QuantumEngineServiceTransport] ] ): The transport to use, or a Callable that constructs and returns a new transport to use. If a Callable is given, it will be called with the same set of initialization arguments as used in the QuantumEngineServiceTransport constructor. If set to None, a transport is chosen automatically. client_options (Optional[google.api_core.client_options.ClientOptions | dict]): Custom options for the client.

1. The ``api_endpoint`` property can be used to override the
default endpoint provided by the client when ``transport`` is
not explicitly provided. Only if this property is not set and
``transport`` was not explicitly provided, the endpoint is
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
variable, which have one of the following values:
"always" (always use the default mTLS endpoint), "never" (always
use the default regular endpoint) and "auto" (auto-switch to the
default mTLS endpoint if client certificate is present; this is
the default value).

2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
is "true", then the ``client_cert_source`` property can be used
to provide a client certificate for mTLS transport. If
not provided, the default SSL client certificate will be used if
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
set, no client certificate will be used.

3. The ``universe_domain`` property can be used to override the
default "googleapis.com" universe. Note that ``api_endpoint``
property still takes precedence; and ``universe_domain`` is
currently not supported for mTLS.

client_info google.api_core.gapic_v1.client_info.ClientInfo

The client info used to send a user-agent string along with API requests. If None, then default info will be used. Generally, you only need to set this if you're developing your own client library.

google.auth.exceptions.MutualTlsChannelError If mutual TLS transport creation failed for any reason.

api_endpoint Return the API endpoint used by the client instance.
transport Returns the transport used by the client instance.
universe_domain Return the universe domain used by the client instance.

Methods

cancel_quantum_job

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_cancel_quantum_job():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.CancelQuantumJobRequest(
    )

    # Make the request
    await client.cancel_quantum_job(request=request)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.CancelQuantumJobRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

cancel_quantum_reservation

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_cancel_quantum_reservation():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.CancelQuantumReservationRequest(
    )

    # Make the request
    response = await client.cancel_quantum_reservation(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.CancelQuantumReservationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumReservation -

common_billing_account_path

View source

Returns a fully-qualified billing_account string.

common_folder_path

View source

Returns a fully-qualified folder string.

common_location_path

View source

Returns a fully-qualified location string.

common_organization_path

View source

Returns a fully-qualified organization string.

common_project_path

View source

Returns a fully-qualified project string.

create_quantum_job

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_create_quantum_job():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.CreateQuantumJobRequest(
    )

    # Make the request
    response = await client.create_quantum_job(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.CreateQuantumJobRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumJob -

create_quantum_program

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_create_quantum_program():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.CreateQuantumProgramRequest(
    )

    # Make the request
    response = await client.create_quantum_program(request=request)

    # Handle the response
    print(response)

Args
request ( Optional[ cirq_google.cloud.quantum_v1alpha1.types.CreateQuantumProgramRequest | dict ] ): The request object. -
retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumProgram -

create_quantum_reservation

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_create_quantum_reservation():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.CreateQuantumReservationRequest(
    )

    # Make the request
    response = await client.create_quantum_reservation(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.CreateQuantumReservationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumReservation -

delete_quantum_job

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_delete_quantum_job():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.DeleteQuantumJobRequest(
    )

    # Make the request
    await client.delete_quantum_job(request=request)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.DeleteQuantumJobRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

delete_quantum_program

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_delete_quantum_program():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.DeleteQuantumProgramRequest(
    )

    # Make the request
    await client.delete_quantum_program(request=request)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.DeleteQuantumProgramRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

delete_quantum_reservation

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_delete_quantum_reservation():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.DeleteQuantumReservationRequest(
    )

    # Make the request
    await client.delete_quantum_reservation(request=request)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.DeleteQuantumReservationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

from_service_account_file

View source

Creates an instance of this client using the provided credentials file.

Args
filename str

The path to the service account private key json file.

args Additional arguments to pass to the constructor.
kwargs Additional arguments to pass to the constructor.

Returns
QuantumEngineServiceAsyncClient The constructed client.

from_service_account_info

View source

Creates an instance of this client using the provided credentials info.

Args
info dict

The service account private key info.

args Additional arguments to pass to the constructor.
kwargs Additional arguments to pass to the constructor.

Returns
QuantumEngineServiceAsyncClient The constructed client.

from_service_account_json

View source

Creates an instance of this client using the provided credentials file.

Args
filename str

The path to the service account private key json file.

args Additional arguments to pass to the constructor.
kwargs Additional arguments to pass to the constructor.

Returns
QuantumEngineServiceAsyncClient The constructed client.

get_mtls_endpoint_and_cert_source

View source

Return the API endpoint and client cert source for mutual TLS.

The client cert source is determined in the following order: (1) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is not "true", the client cert source is None. (2) if client_options.client_cert_source is provided, use the provided one; if the default client cert source exists, use the default one; otherwise the client cert source is None.

The API endpoint is determined in the following order: (1) if client_options.api_endpoint if provided, use the provided one. (2) if GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable is "always", use the default mTLS endpoint; if the environment variable is "never", use the default API endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise use the default API endpoint.

More details can be found at https://google.aip.dev/auth/4114

Args
client_options google.api_core.client_options.ClientOptions

Custom options for the client. Only the api_endpoint and client_cert_source properties may be used in this method.

Returns
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the client cert source to use.

Raises
google.auth.exceptions.MutualTLSChannelError If any errors happen.

get_quantum_calibration

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_calibration():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumCalibrationRequest(
    )

    # Make the request
    response = await client.get_quantum_calibration(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumCalibrationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumCalibration -

get_quantum_job

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_job():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumJobRequest(
    )

    # Make the request
    response = await client.get_quantum_job(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumJobRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumJob -

get_quantum_processor

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_processor():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumProcessorRequest(
    )

    # Make the request
    response = await client.get_quantum_processor(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumProcessorRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumProcessor -

get_quantum_processor_config

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_processor_config():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumProcessorConfigRequest(
        name="name_value",
    )

    # Make the request
    response = await client.get_quantum_processor_config(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumProcessorConfigRequest, dict]]

The request object. -

name (:class:str): Required. - This corresponds to the name field on the request instance; if request is provided, this should not be set.

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumProcessorConfig -

get_quantum_program

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_program():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumProgramRequest(
    )

    # Make the request
    response = await client.get_quantum_program(request=request)

    # Handle the response
    print(response)

Args
request (Optional[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumProgramRequest | dict]): The request object. -
retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumProgram -

get_quantum_reservation

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_reservation():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumReservationRequest(
    )

    # Make the request
    response = await client.get_quantum_reservation(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumReservationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumReservation -

get_quantum_result

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_get_quantum_result():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.GetQuantumResultRequest(
    )

    # Make the request
    response = await client.get_quantum_result(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.GetQuantumResultRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumResult -

get_transport_class

View source

Returns an appropriate transport class.

Args
label The name of the desired transport. If none is provided, then the first transport in the registry is used.

Returns
The transport class to use.

list_quantum_calibrations

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_calibrations():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumCalibrationsRequest(
    )

    # Make the request
    page_result = client.list_quantum_calibrations(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumCalibrationsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumCalibrationsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_job_events

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_job_events():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumJobEventsRequest(
    )

    # Make the request
    page_result = client.list_quantum_job_events(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumJobEventsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumJobEventsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_jobs

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_jobs():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumJobsRequest(
    )

    # Make the request
    page_result = client.list_quantum_jobs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumJobsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumJobsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_processors

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_processors():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumProcessorsRequest(
    )

    # Make the request
    page_result = client.list_quantum_processors(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumProcessorsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumProcessorsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_programs

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_programs():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumProgramsRequest(
    )

    # Make the request
    page_result = client.list_quantum_programs(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumProgramsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumProgramsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_reservation_budgets

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_reservation_budgets():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumReservationBudgetsRequest(
    )

    # Make the request
    page_result = client.list_quantum_reservation_budgets(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumReservationBudgetsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumReservationBudgetsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_reservation_grants

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_reservation_grants():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumReservationGrantsRequest(
    )

    # Make the request
    page_result = client.list_quantum_reservation_grants(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumReservationGrantsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumReservationGrantsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_reservations

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_reservations():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumReservationsRequest(
    )

    # Make the request
    page_result = client.list_quantum_reservations(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumReservationsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumReservationsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

list_quantum_time_slots

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_list_quantum_time_slots():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ListQuantumTimeSlotsRequest(
    )

    # Make the request
    page_result = client.list_quantum_time_slots(request=request)

    # Handle the response
    async for response in page_result:
        print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ListQuantumTimeSlotsRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.services.quantum_engine_service.pagers.ListQuantumTimeSlotsAsyncPager -

Iterating over this object will yield results and resolve additional pages automatically.

parse_common_billing_account_path

View source

Parse a billing_account path into its component segments.

parse_common_folder_path

View source

Parse a folder path into its component segments.

parse_common_location_path

View source

Parse a location path into its component segments.

parse_common_organization_path

View source

Parse a organization path into its component segments.

parse_common_project_path

View source

Parse a project path into its component segments.

parse_quantum_job_path

View source

Parses a quantum_job path into its component segments.

parse_quantum_processor_config_path

View source

Parses a quantum_processor_config path into its component segments.

parse_quantum_processor_path

View source

Parses a quantum_processor path into its component segments.

parse_quantum_program_path

View source

Parses a quantum_program path into its component segments.

parse_quantum_reservation_path

View source

Parses a quantum_reservation path into its component segments.

quantum_job_path

View source

Returns a fully-qualified quantum_job string.

quantum_processor_config_path

View source

Returns a fully-qualified quantum_processor_config string.

quantum_processor_path

View source

Returns a fully-qualified quantum_processor string.

quantum_program_path

View source

Returns a fully-qualified quantum_program string.

quantum_reservation_path

View source

Returns a fully-qualified quantum_reservation string.

quantum_run_stream

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_quantum_run_stream():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.QuantumRunStreamRequest(
    )

    # This method expects an iterator which contains
    # 'quantum_v1alpha1.QuantumRunStreamRequest' objects
    # Here we create a generator that yields a single `request` for
    # demonstrative purposes.
    requests = [request]

    def request_generator():
        for request in requests:
            yield request

    # Make the request
    stream = await client.quantum_run_stream(requests=request_generator())

    # Handle the response
    async for response in stream:
        print(response)

Args
requests (AsyncIterator[cirq_google.cloud.quantum_v1alpha1.types.QuantumRunStreamRequest]): The request object AsyncIterator. -
retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns

AsyncIterable[cirq_google.cloud.quantum_v1alpha1.types.QuantumRunStreamResponse]:

reallocate_quantum_reservation_grant

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_reallocate_quantum_reservation_grant():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.ReallocateQuantumReservationGrantRequest(
    )

    # Make the request
    response = await client.reallocate_quantum_reservation_grant(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.ReallocateQuantumReservationGrantRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumReservationGrant -

update_quantum_job

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_update_quantum_job():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.UpdateQuantumJobRequest(
    )

    # Make the request
    response = await client.update_quantum_job(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.UpdateQuantumJobRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumJob -

update_quantum_program

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_update_quantum_program():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.UpdateQuantumProgramRequest(
    )

    # Make the request
    response = await client.update_quantum_program(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.UpdateQuantumProgramRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumProgram -

update_quantum_reservation

View source

-

.. code-block:: python

# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
#   client as shown in:
#   <a href="https://googleapis.dev/python/google-api-core/latest/client_options.html">https://googleapis.dev/python/google-api-core/latest/client_options.html</a>
from google.cloud import quantum_v1alpha1

async def sample_update_quantum_reservation():
    # Create a client
    client = quantum_v1alpha1.QuantumEngineServiceAsyncClient()

    # Initialize request argument(s)
    request = quantum_v1alpha1.UpdateQuantumReservationRequest(
    )

    # Make the request
    response = await client.update_quantum_reservation(request=request)

    # Handle the response
    print(response)

Args
request Optional[Union[cirq_google.cloud.quantum_v1alpha1.types.UpdateQuantumReservationRequest, dict]]

The request object. -

retry google.api_core.retry_async.AsyncRetry

Designation of what errors, if any, should be retried.

timeout float

The timeout for this request. metadata (Sequence[Tuple[str, str | bytes]]): Key/value pairs which should be sent along with the request as metadata. Normally, each value must be of type str, but for metadata keys ending with the suffix -bin, the corresponding values must be of type bytes.

Returns
cirq_google.cloud.quantum_v1alpha1.types.QuantumReservation -

DEFAULT_ENDPOINT 'quantum.googleapis.com'
DEFAULT_MTLS_ENDPOINT 'quantum.mtls.googleapis.com'