Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide some mechanism to set input values for an experiment run in a manner that is more easy to automate #57

Open
brunorijsman opened this issue Jan 19, 2023 · 0 comments

Comments

@brunorijsman
Copy link
Contributor

Consider the scenario that you want to run an application experiment multiple times, with different input values for each run.

For example, you might want to run the teleport application multiple times, teleporting a different qubit (i.e. different values for the phi and theta input parameters) for each run.

Currently the workflow is as follows:

  • Run qne experiment create

  • Edit the generate file experiment.json and replace the default values of input parameters (e.g. phi and theta) with the desired values

  • Run qne experiment run

This work-flow is difficult to automate, since it requires editing of the file experiment.json

Feature request: provide some mechanism to set input values for an experiment run in a manner that is more easy to automate, for example as command-line arguments for either qne experiment create or qne experiment run.

Note: as a work-around, I am current using a script to edit experiment.json. See the --values command line argument for the run.sh script https://github.com/brunorijsman/quantum-internet-hackathon-2022/blob/main/qne_adk/run.sh

The following example runs the teleport experiment with multiple input values (namely |0>, |1>, |+>, and |->):

$ ./run.sh teleport
Directory containing QNE-ADK applications is /Users/brunorijsman/git-personal/quantum-internet-hackathon-2022/qne_adk
Creating fresh .qne directory in home directory...
Creating fresh teleport_experiment directory...
Copying source file common.py...
Running teleport_experiment using values file minus.json...
Results:
[
  {
    "app_receiver": "receiver finishes",
    "app_sender": "sender finishes"
  }
]
Logs:
receiver_app_log.yaml:
  LOG: receiver starts
  LOG: receiver creates classical socket
  LOG: receiver creates quantum socket
  LOG: receiver creates qasm connection
  LOG: receiver creates entanglement with sender
  LOG: receiver receives correction (1, 0) from sender
  LOG: receiver does not perform X correction
  LOG: receiver performs Z correction
  LOG: receiver density matrix of teleported qubit
  LOG: 0.500 + 0.000i    -0.500 - 0.000i
  LOG: -0.500 + 0.000i    0.500 + 0.000i
sender_app_log.yaml:
  LOG: sender starts
  LOG: phi = 3.14159265359
  LOG: theta = 1.57079632679
  LOG: sender creates classical socket
  LOG: sender creates quantum socket
  LOG: sender creates qasm connection
  LOG: sender creates qubit to teleport
  LOG: sender density matrix of teleported qubit
  LOG: 0.500 + 0.000i    -0.500 - 0.000i
  LOG: -0.500 + 0.000i    0.500 + 0.000i
  LOG: sender creates entanglement with receiver
  LOG: sender performs teleportation
  LOG: sender sends correction message (1, 0) to receiver
Running teleport_experiment using values file one.json...
Results:
[
  {
    "app_receiver": "receiver finishes",
    "app_sender": "sender finishes"
  }
]
Logs:
receiver_app_log.yaml:
  LOG: receiver starts
  LOG: receiver creates classical socket
  LOG: receiver creates quantum socket
  LOG: receiver creates qasm connection
  LOG: receiver creates entanglement with sender
  LOG: receiver receives correction (1, 0) from sender
  LOG: receiver does not perform X correction
  LOG: receiver performs Z correction
  LOG: receiver density matrix of teleported qubit
  LOG: 0.000 + 0.000i    0.000 + 0.000i
  LOG: 0.000 + 0.000i    1.000 + 0.000i
sender_app_log.yaml:
  LOG: sender starts
  LOG: phi = 0.0
  LOG: theta = 3.14159265359
  LOG: sender creates classical socket
  LOG: sender creates quantum socket
  LOG: sender creates qasm connection
  LOG: sender creates qubit to teleport
  LOG: sender density matrix of teleported qubit
  LOG: 0.000 + 0.000i    0.000 + 0.000i
  LOG: 0.000 + 0.000i    1.000 + 0.000i
  LOG: sender creates entanglement with receiver
  LOG: sender performs teleportation
  LOG: sender sends correction message (1, 0) to receiver
Running teleport_experiment using values file plus.json...
Results:
[
  {
    "app_receiver": "receiver finishes",
    "app_sender": "sender finishes"
  }
]
Logs:
receiver_app_log.yaml:
  LOG: receiver starts
  LOG: receiver creates classical socket
  LOG: receiver creates quantum socket
  LOG: receiver creates qasm connection
  LOG: receiver creates entanglement with sender
  LOG: receiver receives correction (1, 0) from sender
  LOG: receiver does not perform X correction
  LOG: receiver performs Z correction
  LOG: receiver density matrix of teleported qubit
  LOG: 0.500 + 0.000i    0.500 + 0.000i
  LOG: 0.500 + 0.000i    0.500 + 0.000i
sender_app_log.yaml:
  LOG: sender starts
  LOG: phi = 0.0
  LOG: theta = 1.57079632679
  LOG: sender creates classical socket
  LOG: sender creates quantum socket
  LOG: sender creates qasm connection
  LOG: sender creates qubit to teleport
  LOG: sender density matrix of teleported qubit
  LOG: 0.500 + 0.000i    0.500 + 0.000i
  LOG: 0.500 + 0.000i    0.500 + 0.000i
  LOG: sender creates entanglement with receiver
  LOG: sender performs teleportation
  LOG: sender sends correction message (1, 0) to receiver
Running teleport_experiment using values file zero.json...
Results:
[
  {
    "app_receiver": "receiver finishes",
    "app_sender": "sender finishes"
  }
]
Logs:
receiver_app_log.yaml:
  LOG: receiver starts
  LOG: receiver creates classical socket
  LOG: receiver creates quantum socket
  LOG: receiver creates qasm connection
  LOG: receiver creates entanglement with sender
  LOG: receiver receives correction (0, 1) from sender
  LOG: receiver performs X correction
  LOG: receiver does not perform Z correction
  LOG: receiver density matrix of teleported qubit
  LOG: 1.000 + 0.000i    0.000 + 0.000i
  LOG: 0.000 + 0.000i    0.000 + 0.000i
sender_app_log.yaml:
  LOG: sender starts
  LOG: phi = 0.0
  LOG: theta = 0.0
  LOG: sender creates classical socket
  LOG: sender creates quantum socket
  LOG: sender creates qasm connection
  LOG: sender creates qubit to teleport
  LOG: sender density matrix of teleported qubit
  LOG: 1.000 + 0.000i    0.000 + 0.000i
  LOG: 0.000 + 0.000i    0.000 + 0.000i
  LOG: sender creates entanglement with receiver
  LOG: sender performs teleportation
  LOG: sender sends correction message (0, 1) to receiver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant