Circuit tester
- Module to simulate the quantum circuit generated by the compiler,
with noisy gates using quantum trajectories and qmathcatea
- class vulqano.circuit_tester.ContinuosOperations(id_infidelity, weights_dict, infidelity_method='gaussian', cross_talk='gaussian')[source]
Class to handle the discrete oprations of a given simulation
Arguments
- id_infidelity: float
What should be the infidelity of an identity, i.e. of an idle qubit. It is used as scale for the infidelity of all the other operations, which are defined as id_infidelity*weights_dict[“operation”].
- weights_dict: Dictionary[(str, float)]
Dictionary with the infidelity weight of each operation.
- infidelity_methodstr | callable, optional
Way to implement the infidelity of the gate. If str, you have to choose from the available methods: - “gaussian”, add gaussian noise to the matrix - “gaussian_on_params”, add gaussian noise to the gate parameters If callable, it should be a function that takes in input the gate name and gate parameters and returns the gate matrix with the error.
- cross_talkstr | callable
Crosstalk model. - If “gaussian”, use gaussian noise on the four-qubits gate If callable, it should be a function that takes in input the gate name (with the xtalk configuration) and returns the gate matrix with the error. Default to None.
- class vulqano.circuit_tester.DiscreteOperations(id_infidelity, weights_dict, infidelity_method='gaussian', cross_talk='gaussian')[source]
Class to handle the discrete oprations of a given simulation
Arguments
- id_infidelity: float
What should be the infidelity of an identity, i.e. of an idle qubit. It is used as scale for the infidelity of all the other operations, which are defined as id_infidelity*weights_dict[“operation”].
- weights_dict: Dictionary[(str, float)]
Dictionary with the infidelity weight of each operation.
- infidelity_methodstr | callable, optional
Way to implement the infidelity of the gate. If str, you have to choose from the available methods: - “gaussian”, add gaussian noise If callable, it should be a function that takes in input the gate name and returns the gate matrix with the error.
- cross_talkstr | callable
Crosstalk model. - If “gaussian”, use gaussian noise on the four-qubits gate If callable, it should be a function that takes in input the gate name (with the xtalk configuration) and returns the gate matrix with the error. Default to None.
- property operations
Property giving a list of the available operations
- vulqano.circuit_tester.qmatchatea_simulation(filename, operations, conv_params, num_trajectories=1000, backend=qmatchatea.QCBackend, tensor_backend=qtealeaves.tensors.TensorBackend, initialize='random_basis')[source]
Run several simulations of a qasm file named filename using quantum matcha tea starting from random basis states for num_trajectories times. It computes the fidelity |<psi|U U°|psi>|^2 with U being the noiseless version of U°, and |psi> a random state at a given bond dimension
Arguments
- filenamestr
Name of the qasm file containing the circuit to run
- operationsDiscreteOperations
The operations available in the circuit
- num_trajectories: int, optional
Number of trajectories
Returns
- np.ndarray[float]
The numpy array of the fidelities
- np.ndarray[float]
The numpy array of the infidelities from tensor network truncation
- vulqano.circuit_tester.read_qasm_function(filename, operations)[source]
Read a qasm file and build a Qcircuit object for the qmatchatea simulation. Works only when a single register is there.
Arguments
- filename: str
Filename of the qasm file to read
- operations: DiscreteOperations
Operations class to handle the noise
Returns
- Qcircuit
A Quantum circuit class to run with qmatchatea representing a single trajectory