Markovian dynamics
Here we define the function that performs optimization based on markovian dynamics of a circuit state (e.g. simulated annealing).
- vulqano.markoviandynamics.simulated_annealing(input_circuit, machine, sa_instructions, verbose=False, inspection_mode=False, max_result_size=10000)[source]
Performs a simulated annealing of the input circuit.
Arguments
- input_circuitAbstractCircuitState
The circuit state at the begining of the annealing process.
- machinedictionary
- qubitstouple
Number of qubits of the machine for each spatial axis
- hamiltonianlist of (np.array of strings, float, mask)
Abstract description of the Hamiltonian. The energy is obtained by counting how many times each subcircuit hamiltonian_operator[i][0] appears on a region A of the circuit suck that that hamiltonian_operator[i][2] is True for all (t,q) in A. The counted number is multiplied by the weight hamiltonian_operator[i][1].
- gatesset
Gates enabled on the machine (virtual gates included).
- sa_instructionsdictionary
- stepsint
Number of time steps.
- t_schedulefunction
A function returning the system temperature at each step.
- rules_classesstr or list of ints, optional
A list of the ints identifying the rule classes that we want to generate. Default is “all” and generates all the rule classes.
- generators“std” or list of generators, optional
The list of generators producing the rules to be used. Default is “std”, in this case a standard list of rules is used.
- pulsesfunction, optional
A function returning the weight of each class of transitions at each steps. If this key is not specified, we use equal probability.
- inspection_modebool, optional
If true, after each transition the fidelity of the circuit state with the initial state is measured. If the fidelity is different than zero, an error is raised and the last transition is shown. The inspection mode can be applied only to states with a maximum number of 8 qubits.
- verbosebool, optional
If false, no message is shown. Default is False.
- max_results_sizeint, optional
Max size of the energy evolution in output. If max_results_size is smaller than the number of steps in the time_schedule, the energy_evolution is coars grained by averaging on steps windows. Default is 10000.
Returns
- output_dictionarydictionary
- sa_parametersdictionary
- software_versionstr
Version of the software used for the simulation.
- initial_stateCircuitState
See Parameters
- machinedictionary
See Parameters
- sa_instructionsdictionary
See Parameters
- sa_resultsdictionary
- computational_timefloat
total computational time of the simulated annealing.
- initial_energyfloat
Initial energy
- final_energyfloat
Final energy
- final_stateCircuitState
The circuit state at the end of the annealing process.
- energy_statisticsnumpy.array
A matrix that associate to each temperature the average energy around that temperature.
- rules_statisticsdictionary
A dictionary that associates to each rules class the number of times that the contained rules have been used in the mcmc.