:doc:`Braket <../../braket>` / Client / get_quantum_task

****************
get_quantum_task
****************



.. py:method:: Braket.Client.get_quantum_task(**kwargs)

  

  Retrieves the specified quantum task.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/braket-2019-09-01/GetQuantumTask>`_  


  **Request Syntax**
  ::

    response = client.get_quantum_task(
        quantumTaskArn='string',
        additionalAttributeNames=[
            'QueueInfo',
        ]
    )
    
  :type quantumTaskArn: string
  :param quantumTaskArn: **[REQUIRED]** 

    The ARN of the quantum task to retrieve.

    

  
  :type additionalAttributeNames: list
  :param additionalAttributeNames: 

    A list of attributes to return additional information for. Only the QueueInfo additional attribute name is currently supported.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'quantumTaskArn': 'string',
          'status': 'CREATED'|'QUEUED'|'RUNNING'|'COMPLETED'|'FAILED'|'CANCELLING'|'CANCELLED',
          'failureReason': 'string',
          'deviceArn': 'string',
          'deviceParameters': 'string',
          'shots': 123,
          'outputS3Bucket': 'string',
          'outputS3Directory': 'string',
          'createdAt': datetime(2015, 1, 1),
          'endedAt': datetime(2015, 1, 1),
          'tags': {
              'string': 'string'
          },
          'jobArn': 'string',
          'queueInfo': {
              'queue': 'QUANTUM_TASKS_QUEUE'|'JOBS_QUEUE',
              'position': 'string',
              'queuePriority': 'Normal'|'Priority',
              'message': 'string'
          },
          'associations': [
              {
                  'arn': 'string',
                  'type': 'RESERVATION_TIME_WINDOW_ARN'
              },
          ],
          'numSuccessfulShots': 123,
          'actionMetadata': {
              'actionType': 'string',
              'programCount': 123,
              'executableCount': 123
          },
          'experimentalCapabilities': {
              'enabled': 'ALL'|'NONE'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **quantumTaskArn** *(string) --* 

        The ARN of the quantum task.

        
      

      - **status** *(string) --* 

        The status of the quantum task.

        
      

      - **failureReason** *(string) --* 

        The reason that a quantum task failed.

        
      

      - **deviceArn** *(string) --* 

        The ARN of the device the quantum task was run on.

        
      

      - **deviceParameters** *(string) --* 

        The parameters for the device on which the quantum task ran.

        
      

      - **shots** *(integer) --* 

        The number of shots used in the quantum task.

        
      

      - **outputS3Bucket** *(string) --* 

        The S3 bucket where quantum task results are stored.

        
      

      - **outputS3Directory** *(string) --* 

        The folder in the S3 bucket where quantum task results are stored.

        
      

      - **createdAt** *(datetime) --* 

        The time at which the quantum task was created.

        
      

      - **endedAt** *(datetime) --* 

        The time at which the quantum task ended.

        
      

      - **tags** *(dict) --* 

        The tags that belong to this quantum task.

        
        

        - *(string) --* 
          

          - *(string) --* 
    
  
      

      - **jobArn** *(string) --* 

        The ARN of the Amazon Braket job associated with the quantum task.

        
      

      - **queueInfo** *(dict) --* 

        Queue information for the requested quantum task. Only returned if ``QueueInfo`` is specified in the ``additionalAttributeNames"`` field in the ``GetQuantumTask`` API request.

        
        

        - **queue** *(string) --* 

          The name of the queue.

          
        

        - **position** *(string) --* 

          Current position of the quantum task in the quantum tasks queue.

          
        

        - **queuePriority** *(string) --* 

          Optional. Specifies the priority of the queue. Quantum tasks in a priority queue are processed before the quantum tasks in a normal queue.

          
        

        - **message** *(string) --* 

          Optional. Provides more information about the queue position. For example, if the quantum task is complete and no longer in the queue, the message field contains that information.

          
    
      

      - **associations** *(list) --* 

        The list of Amazon Braket resources associated with the quantum task.

        
        

        - *(dict) --* 

          The Amazon Braket resource and the association type.

          
          

          - **arn** *(string) --* 

            The Amazon Braket resource arn.

            
          

          - **type** *(string) --* 

            The association type for the specified Amazon Braket resource arn.

            
      
    
      

      - **numSuccessfulShots** *(integer) --* 

        The number of successful shots for the quantum task. This is available after a successfully completed quantum task.

        
      

      - **actionMetadata** *(dict) --* 

        Metadata about the action performed by the quantum task, including information about the type of action and program counts.

        
        

        - **actionType** *(string) --* 

          The type of action associated with the quantum task.

          
        

        - **programCount** *(integer) --* 

          The number of programs in a program set. This is only available for a program set.

          
        

        - **executableCount** *(integer) --* 

          The number of executables in a program set. This is only available for a program set.

          
    
      

      - **experimentalCapabilities** *(dict) --* 

        Enabled experimental capabilities for the quantum task, if any.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``enabled``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


      
        

        - **enabled** *(string) --* 

          Enabled experimental capabilities.

          
    
  
  **Exceptions**
  
  *   :py:class:`Braket.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`Braket.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Braket.Client.exceptions.ThrottlingException`

  
  *   :py:class:`Braket.Client.exceptions.InternalServiceException`

  
  *   :py:class:`Braket.Client.exceptions.ValidationException`

  