MIMIQ Cloud interaction

MimiqLink.ConnectionType
struct Connection

Connection with the MIMIQ Services.

Attributes

  • uri: the URI of the connected instance
  • tokens_channel: channel updated with the latest refreshed token
  • refresher: task that refreshes the token on a configured interval
MimiqLink.ExecutionType
struct Execution

Structure referring to an execution on the MIMIQ Services.

MimiqLink.connectFunction
connect([; url=https://mimiq.qperfect.io])
connect(token[; url=https://mimiq.qperfect.io])
connect(username, password[; url=https://mimiq.qperfect.io])

Establish a connection to the MIMIQ Services.

A refresh process will be spawned in the background to refresh the access credentials. An active connection can be closed by using the close(connection) method. As an example:

connection = connect("john.doe@example.com", "johnspassword")
close(connection)
Warning

The first method will open a login page in the default browser and ask for your email and password. This method is encouraged, as it will avoid saving your password as plain text in your scripts or notebooks.

MimiqLink.savetokenFunction
savetoken([filename][; uri="https://mimiq.qperfect.io/api"])

Establish a connection to the MIMIQ Services and save the credentials in a JSON file.

Arguments

  • filename: file where to save the credentials (default: qperfect.json)

Keyword arguments

  • uri: the uri of the MIMIQ Services (default: https://mimiq.qperfect.io/api)

Example

julia> savetoken("myqperfectcredentials.json")

julia> connection = loadtoken("myqperfectcredentials.json")
MimiqLink.loadtokenFunction
loadtoken([filename])

Establish a connection to the MIMIQ Services by loading the credentials from a JSON file.

Arguments

  • filename: file where to load the credentials (default: qperfect.json)
Note

The credentials are usually valid only for a small amount of time, so you may need to regenerate them from time to time.

Example

julia> savetoken("myqperfectcredentials.json")

julia> connection = loadtoken("myqperfectcredentials.json")
MimiqCircuits.getresultsFunction
getresults(connection, execution; kwargs...)

Block until the given execution is finished and return the results.

Keyword Arguments

  • interval: time interval in seconds to check for job completion (default: 10)
MimiqCircuits.getinputsFunction
getinputs(connection, execution)

Returns the circuit and parameters for the given execution.

MimiqCircuits.executeFunction
execute(connection, circuit[; kwargs...])

Execute a quantum circuit on the MIMIQ remote services.

The circuit is applied to the zero state and the resulting state is measured via sampling. Optionally amplitudes corresponding to few selected bit states (or bitstrings) can be returned from the computation.

Keyword Arguments

  • label::String: mnemonic name to give to the simulation, will be visible on the web interface
  • algorithm: algorithm to use by the compuation. By default "auto" will select the fastest algorithm between "statevector" or "mps".
  • nsamples::Integer: number of times to sample the circuit (default: 1000, maximum: 2^16)
  • bitstates::Vector{BitState}: list of bit states to compute the amplitudes for (default: BitState[])
  • timelimit: number of seconds before the computation is stopped (default: 300 seconds or 5 minutes)
  • bonddim::Int64: bond dimension for the MPS algorithm (default: 256, maximum: 4096)
  • seed::Int64: a seed for running the simulation (default: random seed)
MimiqCircuits.printreportFunction
printreport(res::MimiqCircuits.Results; kwargs...)

Print a report on the MIMIQ simulation results res

Keyword Arguments

  • max_outcomes: the maximum number of unique measurement outcomes to display (default 8)

Index