Configure experiment
How to edit your experiment and make it ready to run
After creating your experiment, you should have an experiment directory containing all necessary files. If you haven't created an experiment yet, first go to Create experiment. This section describes what the experiment.json file consists of and how it can be modified to make it ready for a run.
Experiment.json configuration
In experiment.json you can adjust which network and which nodes/channels you use. In addition, you can adjust the values you entered as inputs when configuring your application. The experiment.json file is built up out of two parts, namely: the meta and asset.
Meta
The meta attribute contains three attributes that describe the runtime configuration. This entails the backend is local on which the experiment is run, how many times to run, and a short description:
"meta": {
"backend": {
"location": "local",
"type": <slug-of-the-backendtype>
},
"number_of_rounds": <number-of-rounds>,
"description": <text>
}
An example of what the meta could look like is as follows:
"meta": {
"backend": {
"location": "local",
"type": "local_netsquid"
},
"number_of_rounds": 1,
"description": "teleport: experiment description"
}
Note: For now, only a 'local' location, only one 'number_of_rounds' and type 'local_netsquid' as simulator are supported. So it is best to leave these values as they are.
Asset
The asset contains the user input for the configuration of both the network and the application. The asset is built up out of a network and application property. The network contains all information about the nodes and channels which are available for this network. The application property describes all inputs of the application, what role(s) is/are linked to this input, and what value it stores.
Network
The network property contains a name, slug, and roles and is built up out of multiple nodes and channels. Depending on what network has been chosen to run the experiment on, the values of the name, slug, node and channels have already been generated and should be left as it is. In the roles property, you can link your role names to a node belonging to the network.
Each channel has its own template, containing the properties name, node1, node2, and parameters. All channels belonging to this network are listed, each having the correct slug and node names. So you don't have to change any of these values. You can tweak the 'parameter' values by setting the value property and scale_value to your liking. Below, an example is given of what a single channel looks like:
{
"slug": "amsterdam-leiden",
"node1": "amsterdam",
"node2": "leiden",
"parameters": [
{
"slug": "elementary-link-fidelity",
"values": [
{
"name": "fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
]
}
In addition, a node also consists of a kind of template in which it consists of a name, slug, coordinates, node_parameters, and a list of qubits. Again, none of these values have to be changed. However, you can change the value and scale_value of the node_parameters to your liking, as well as the value and scale_value of the qubits. Below, an example of a single node is given:
{
"name": "Amsterdam",
"slug": "amsterdam",
"coordinates": {
"latitude": 52.3667,
"longitude": 4.8945
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
}
All channels and nodes belonging to the chosen network are automatically generated. So no channels or nodes need to be added or deleted.
Finally, a network also has the property roles, which is a dictionary where you can link your role names to any desired node slug. For example:
"roles": {
"Sender": "amsterdam",
"Receiver": "leiden"
}
Note: make sure that each role has its own node. For example, in the example above, 'Sender' and 'Receiver' cannot both be paired with 'amsterdam'.
Application
The asset also has an application property which is a list of all the inputs of your application. Each input consists of a roles and values dictionary. Here you can assign roles to inputs and give it a certain value. An example of a single input looks like this:
{
"roles": [
"Sender"
],
"values": [
{
"name": "x",
"value": 0,
"scale_value": 1.0
}
]
}
You can validate your experiment by using the command (assuming you are in your experiment root directory). This checks that all necessary files are present and that the structure of experiment.json is correct. When done, you're ready to run your experiment.
qne experiment validate
Example
An complete example of what the experiment.json could look like is given below:
{
"meta": {
"backend": {
"location": "local",
"type": "local_netsquid"
},
"number_of_rounds": 1,
"description": "teleport_experiment: experiment description"
},
"asset": {
"network": {
"name": "Randstad",
"slug": "randstad",
"channels": [
{
"slug": "amsterdam-leiden",
"node1": "amsterdam",
"node2": "leiden",
"parameters": [
{
"slug": "elementary-link-fidelity",
"values": [
{
"name": "fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
]
},
{
"slug": "leiden-the-hague",
"node1": "leiden",
"node2": "the-hague",
"parameters": [
{
"slug": "elementary-link-fidelity",
"values": [
{
"name": "fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
]
},
{
"slug": "delft-the-hague",
"node1": "delft",
"node2": "the-hague",
"parameters": [
{
"slug": "elementary-link-fidelity",
"values": [
{
"name": "fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
]
},
{
"slug": "delft-rotterdam",
"node1": "delft",
"node2": "rotterdam",
"parameters": [
{
"slug": "elementary-link-fidelity",
"values": [
{
"name": "fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
]
}
],
"nodes": [
{
"name": "Amsterdam",
"slug": "amsterdam",
"coordinates": {
"latitude": 52.3667,
"longitude": 4.8945
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
},
{
"name": "Leiden",
"slug": "leiden",
"coordinates": {
"latitude": 52.1601,
"longitude": 4.497
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
},
{
"name": "The Hague",
"slug": "the-hague",
"coordinates": {
"latitude": 52.0705,
"longitude": 4.3007
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
},
{
"name": "Delft",
"slug": "delft",
"coordinates": {
"latitude": 52.0116,
"longitude": 4.3571
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
},
{
"name": "Rotterdam",
"slug": "rotterdam",
"coordinates": {
"latitude": 51.9244,
"longitude": 4.4777
},
"node_parameters": [
{
"slug": "gate-fidelity",
"values": [
{
"name": "gate_fidelity",
"value": 1.0,
"scale_value": 1.0
}
]
}
],
"qubits": [
{
"qubit_id": 0,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 1,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
},
{
"qubit_id": 2,
"qubit_parameters": [
{
"slug": "relaxation-time",
"values": [
{
"name": "t1",
"value": 0,
"scale_value": 1.0
}
]
},
{
"slug": "dephasing-time",
"values": [
{
"name": "t2",
"value": 0,
"scale_value": 1.0
}
]
}
]
}
]
}
],
"roles": {
"Sender": "amsterdam",
"Receiver": "leiden"
}
},
"application": [
{
"roles": [
"Sender"
],
"values": [
{
"name": "phi",
"value": 0.0,
"scale_value": 1.0
},
{
"name": "theta",
"value": 0.0,
"scale_value": 1.0
}
]
}
]
}
}