qubiter.quantum_CSD_compiler.Node module¶
-
class
qubiter.quantum_CSD_compiler.Node.
Node
(nd_id, pa_nd, side, init_unitary_mat=None)[source]¶ Bases:
object
This class carries the “cargo” of each node of a tree. Included in that cargo are
- self’s parent and 2 children nodes,
- its side, level and id,
- its left, central and right matrix lists.
This class also performs the very important task of calling within its constructor the function CS_Decomp.get_csd() which fills the node’s left, central and right matrix lists.
Variables: - central_mats (list(np.ndarray)) – Central matrix list returned by call to CS_Decomp.get_csd( ). A central_mats is a list of dmats. A dmat= D matrix is numpy array containing floats (radian angles).
- left_mats (list(np.ndarray)) – Left matrix list returned by call to CS_Decomp.get_csd()
- left_nd (Node) – Node to left of self.
- level (int) – 1<= level <= num_qbits+1. level = 1 for root node, level = num_of_bits+1 for node whose central_mat is list of 1 dim arrays
- nd_id (int) – node id, int assigned by Tree, nd_id=0 for first (root) node created by Tree, nd_id=1 for second node created, etc.
- pa_nd (Node) – parent node
- right_mats (list(np.ndarray)) – Right matrix list returned by call to CS_Decomp.get_csd()
- right_nd (Node) – Node to right of self.
- side (str) – to which side of its parent does self find itself, either ‘right’ or ‘left’
-
__init__
(nd_id, pa_nd, side, init_unitary_mat=None)[source]¶ Constructor
Parameters: - nd_id (int) –
- pa_nd (Node|None) –
- side (str|None) –
- init_unitary_mat (np.ndarray) – This is the matrix that is fed to CS_Decomp.get_csd() in root node constructor. pa_nd and side are ignored if this is not None.
-
__str__
()[source]¶ Gives a readable description of self when self is ordered to print. For example, if nd_id = 3, level = 4, node prints as ‘3(L4)’.
Returns: Return type: str