qubiter.CodaSEO_writer module¶
-
class
qubiter.CodaSEO_writer.
CodaSEO_writer
(init_file_prefix, fin_file_prefix, num_qbits, ZL=True, fin_emb=None)[source]¶ Bases:
qubiter.SEO_writer.SEO_writer
This class is a child of class SEO_writer. The constructor of this class accepts as input the paths to a pair of well-formed initial English and Picture files. The class makes copies of those 2 initial files and opens the copies, called the final English and Picture files, in the append mode. Thereafter, the user can write to those final files using methods that this class inherits from its parent SEO_writer. Coda SEO writer means tail-end SEO writer, which accurately describes what this class does.
Variables: - fin_eng_path (str) – path to final English file that starts life as a verbatim copy of the initial English file and is thereafter appended to.
- fin_pic_path (str) – path to final Picture file that starts life as a verbatim copy of the initial Picture file and is thereafter appended to.
-
__init__
(init_file_prefix, fin_file_prefix, num_qbits, ZL=True, fin_emb=None)[source]¶ Parameters: - init_file_prefix (str) –
- fin_file_prefix (str) –
- num_qbits (int) –
- ZL (bool) –
- fin_emb (CktEmbedder) – circuit embedder for the writer of the final English and Picture files
-
write_xy_measurements
(bit_pos_to_xy_str, write_notas=True)[source]¶ This method will append to the final English and Picture files a SEO of rotations, one rotation at each key of the input dictionary bit_pos_to_xy_str. That input dictionary bit_pos_to_xy_str maps qubit positions (int) to xy str values that are: either ‘X’ or ‘Y’.
Let sigx, sigy and sigz be the Pauli matrices.
When key=b and value=’X’, a rotation exp(i*sigy*pi/4) is applied to qubit b. This rotation is chosen because it diagonalizes sigx, according to the equation: exp(-i*sigy*pi/4)*sigz*exp(i*sigy*pi/4) = sigx.
When key=b and value=’Y’, a rotation exp(-i*sigx*pi/4) is applied to qubit b. This rotation is chosen because it diagonalizes sigy, according to the equation: exp(i*sigx*pi/4)*sigz*exp(-i*sigx*pi/4) = sigy.
These rotations are applied in order to convert an X or Y qubit measurement into the standard Z measurements which are along the eigenvectors of sigz. There is no need to apply any rotations when Z is measured because the operating qubit basis is already the eigenvectors of sigz.
Parameters: - bit_pos_to_xy_str (dict[int, str]) –
- write_notas (bool) – whether to write a NOTA before each rotation explaining it
Returns: Return type: None