-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
30 lines (26 loc) · 1.01 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ast
from django.db import models
from django.db.models.fields import TextField, FloatField, SmallIntegerField
class Run(models.Model):
created = models.DateTimeField(auto_now_add=True)
distance = FloatField(default=None)
energy = FloatField(default=None)
variables = TextField(default="")
energies = TextField(default="")
gradients = TextField(default="")
angles = TextField(default="")
energies_calls = TextField(default="")
gradients_calls = TextField(default="")
angles_calls = TextField(default="")
hamiltonian = TextField(default="")
ansatz = TextField(default="")
qubits = SmallIntegerField(default=0)
fermionic_depth = SmallIntegerField(default=0)
elementary_depth = SmallIntegerField(default=0)
single_qubit_gates = SmallIntegerField(default=0)
double_qubit_gates = SmallIntegerField(default=0)
class Meta:
abstract = True
ordering = ['created']
def get_iteration_energies(self):
return ast.literal_eval(self.energies)