# Dirac-1

### Overview

Dirac-1 is a "qubit" entropy quantum computer. It minimizes quadratic Hamiltonian operators over a n-binary domain, where n is the variable size. It uses the same principles as all other EQC devices to perform computations.

### Our Binary Programming model

Our binary programming model, available on the Dirac-1 quantum computer, is

$H(z)=\sum_jh_jz_j+\sum_{ij}J_{ij}z_iz_j$

where the

*z’s*are*binary variables*which can have the values 0 or 1 and {h, J} are constants. Analogous to the QUBO and Ising model, the programmer’s job is to set the*h*values (linear terms) and*J*values (quadratic terms) in order to solve the problem, which has been expressed in binary decision variables.## Data format

To upload a Hamiltonian operator, we encode it in a sparse matrix format as shown below. We use Numpy array notation. The order-2 Hamiltonian supported by Dirac-2 has two parts. The first part is a single-dimension array for the linear terms. The second part is a two-dimension array for the quadratic terms. They will be called `h` and `J`, respectively.

1

`h = np.array([-1, -1, -1])`

1

`J = np.array([[0, -1.5, 0.5], [-1.5, 0, 0], [0.5, 0, 0]])`

We put these together into one matrix sized

`NxN+1`

. 1

`H = np.hstack([h, J])`

then the JSON will take the following list of dictionary sparse matrix format:

` {(i,j): value}`

123456789101112131415161718192021222324252627282930313233343536373839404142

```
hamiltonian_data = {
"data": [
{
"i": 0,
"j": 0,
"val": -1
},
{
"i": 1,
"j": 0,
"val": -1
},
{
"i": 2,
"j": 0,
"val": -1,
},
{
"i": 0,
"j": 2,
"val": -1.5
},
{
"i": 0,
"j": 3,
"val": 0.5
},
{
"i": 1,
"j": 1,
"val": -1.5
},
{
"i": 2,
"j": 1,
"val": 0.5
}
],
"file_name": "simple_hamiltonian.json", # can be any short string
"num_variables": 3, # number of rows
"file_type": "hamiltonian" # defines the data type as hamiltonian
}
```

## Uploading

To upload the matrix encoded above in

`hamiltonian_data`

, we use the the `qci_client`

imported previously. The following line 1

`response_json = qci.upload_file(qubo_data)`

The response contains a

`file_id`

for the uploaded file. This id is provided when a job is run, along a few other parameters (see #Running). Note: the same `file_id`

can be used multiple times to run a problem repeatedly. This enables an "upload once, run many times" scheme, which is especially useful for job types in which parameter searches may be involved.