> This page is for version latest (default).
> For other versions, use one of these documentation indexes:
> - latest (default): https://docs.nvidia.com/alchemi/vasp/latest/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/alchemi/vasp/llms.txt.

# Get calculation result

GET http://localhost:8000/result/{request_id}

Retrieve the result of a previously submitted calculation. Blocks until the task completes or `wait_timeout` seconds elapse. Results are deleted from the service once retrieved.


Reference: https://docs.nvidia.com/alchemi/vasp/alchemi-qc-api/calculations/get-result

## Request

### Path parameters

- `request_id` (string, required) — The unique identifier for a calculation, returned by `/submit` or `/infer`.

### Query parameters

- `wait_timeout` (double, optional) — How long to wait for a running task to finish, in seconds. Omit to wait indefinitely.

## Response

### 200

The calculation result.

- `atoms` (AtomicData, required) — The output atomic structure, which may differ from the input after a relaxation.
- `results` (VASPResult, required, nullable) — Results of the computation, or null if it failed.
- `config` (VASPConfig, required, nullable) — The configuration used for the calculation.
- `request_id` (string, optional, nullable) — Identifier used to correlate the reply with output files.
- `info` (string, optional, nullable) — The metadata string passed with the request.
- `success` (boolean, optional, default: true) — Whether the computation completed successfully.
- `failure_info` (FailureInformation, optional, nullable) — Failure details if the computation did not succeed.
- `memory` (MemoryStats, optional, nullable) — Memory usage statistics during the computation.
- `runtime` (double, optional, nullable) — Runtime of the computation in seconds, excluding queue time.

## Errors

### 404 Not Found Error

No result exists for the given identifier, or it was already retrieved.

- `detail` (string, required) — Human-readable description of the error.

### 503 Service Unavailable Error

The task did not complete before the timeout elapsed, or the client disconnected.

- `detail` (string, required) — Human-readable description of the error.

## Types

### AtomicData

Software-agnostic description of an atomic structure.

- `coord` (list of double, required) — Atomic coordinates as a flat list [x1, y1, z1, x2, y2, z2, ...].
- `numbers` (list of integer, required) — Atomic numbers for each atom.
- `charge` (integer, optional, nullable, default: 0) — Total charge of the system.
- `mult` (integer, optional, nullable, default: 1) — Spin multiplicity (2S+1).
- `cell` (list of double, optional, nullable) — Unit cell as 9 elements in a flattened list.
- `pbc` (list of boolean, optional, default: [false,false,false]) — Periodic boundary condition flags for each cell vector.
- `structure_id` (string, optional, nullable, default: ) — Optional identifier for the structure.

### VASPResult

Results parsed from a completed VASP calculation.

- `scf_converged` (boolean, required) — Whether the SCF calculation converged within tolerance.
- `opt_converged` (boolean, optional, nullable) — Whether the geometry optimization converged.
- `e_tot` (double, optional, nullable) — Total electronic energy in eV.
- `forces` (list of double, optional, nullable) — Nuclear gradients (forces) in eV/Angstrom, flattened.
- `stress` (list of double, optional, nullable) — Stress tensor components in kBar.
- `band_gap` (list of double, optional, nullable) — Band gap energy for the spin-up and spin-down bands in eV.
- `total_mag` (VaspResultTotalMag, optional, nullable) — Total magnetization as a scalar, or a vector for non-collinear calculations.
- `magmoms` (list of double, optional, nullable) — Magnetic moment for each atom. Length equals the number of atoms (collinear) or three times the number of atoms (non-collinear).
- `exit_code` (integer, optional, nullable) — The exit code from the VASP process.
- `stdout` (string, optional, nullable) — Standard output from VASP, truncated to 8192 characters.
- `stderr` (string, optional, nullable) — Standard error from VASP, truncated to 8192 characters.

### VASPConfig

Configuration that defines how VASP is launched for a calculation.

- `version` (enum, optional, default: std) — Which VASP executable to use: `std` for standard, `ncl` for non-collinear spins, `gam` for gamma-point only.
  - Allowed values: `std`, `ncl`, `gam`
- `potcar_type` (string, optional, default: PAW_PBE_64) — Which generation of POTCAR to use. Maps to a directory in the POTCAR library. Overridden when `potcar_defaults` is provided.
- `potcar_symbols` (list of string, optional, nullable) — Element symbols to use for the POTCAR file. The default POTCAR for an element shares its name, so only overrides need to be supplied (e.g. `Be_sv`).
- `potcar_defaults` (string, optional, nullable) — A preset list of pseudopotentials. Use `vasp-rec` for the recommended VASP set or the name of a pymatgen VaspInputSet. Cannot be combined with `potcar_symbols`.

### FailureInformation

Information about a task failure.

- `exception` (string, required) — The exception raised by the failed task.
- `traceback` (string, optional, nullable) — Full stack trace for the exception, if available.

### MemoryStats

Peak memory usage statistics collected during a calculation.

- `peak_gpu_mem` (double, optional, nullable) — Peak GPU memory usage in MB, or null if GPU monitoring was disabled.
- `peak_ram_mem` (double, optional, nullable) — Peak RAM usage in MB, or null if RAM monitoring was disabled.

### VaspResultTotalMag

Total magnetization as a scalar, or a vector for non-collinear calculations.

- double
- list of double

## Examples

**Response**

```json
{
  "atoms": {
    "coord": [
      0,
      0,
      0,
      0.5,
      0.5,
      0
    ],
    "numbers": [
      29,
      29
    ],
    "charge": 0,
    "mult": 1,
    "cell": [
      3.52,
      0,
      0,
      0,
      3.52,
      0,
      0,
      0,
      3.52
    ],
    "pbc": [
      true
    ],
    "structure_id": ""
  },
  "results": {
    "scf_converged": true,
    "opt_converged": true,
    "e_tot": 1.1,
    "forces": [
      1.1
    ],
    "stress": [
      1.1
    ],
    "band_gap": [
      1.1
    ],
    "total_mag": 1.1,
    "magmoms": [
      1.1
    ],
    "exit_code": 1,
    "stdout": "string",
    "stderr": "string"
  },
  "config": {
    "version": "std",
    "potcar_type": "PAW_PBE_64",
    "potcar_symbols": [
      "Be_sv"
    ],
    "potcar_defaults": "vasp-rec"
  },
  "request_id": "string",
  "info": "string",
  "success": true,
  "failure_info": {
    "exception": "VASP Nonzero Exit",
    "traceback": "string"
  },
  "memory": {
    "peak_gpu_mem": 1.1,
    "peak_ram_mem": 1.1
  },
  "runtime": 1.1
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/result/b5e002d5-286b-44e0-b7c5-dd407bc461d3")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```