pygsti.tools.internalgates.standard_gatenames_openqasm_conversions

pygsti.tools.internalgates.standard_gatenames_openqasm_conversions#

standard_gatenames_openqasm_conversions(version='u3')#

A dictionary converting the gates with standard names to the QASM names for these gates.

See standard_gatename_unitaries().

Note that throughout pyGSTi the standard gatenames (e.g., ‘Gh’ for Hadamard) are not enforced to correspond to the expected unitaries. So, if the user has, say, defined ‘Gh’ to be something other than the Hadamard gate this conversion dictionary will be incorrect.

Parameters:

version (string, optional) – Either ‘u3’ or ‘x-sx-rz’. Specifies the naming convention for the QASM gates. With ‘u3’, all single-qubit gates are specified in terms of the ‘u3’ gate, used by IBM and QisKit until ~2021 (see the qasm_u3 function). With ‘x-sx-rz’, all single-gates are specified in terms of ‘x’ (an x pi rotation), ‘sx’ (an x pi/2 rotation) and ‘rz’ (a parameterized rotation around z by an angle theta).

Returns:

  • dict – mapping strings (representing pyGSTi standard gate names) to list of strings (representing QASM gate names).

  • dict – mapping strings (representing pyGSTi standard gate names) to functions that map the parameters of a pyGSTi gate to a string to be combined with the QASM name to specify the specific gate, in QASM.