Quanlse/Utils/Plot.py
def plotProcess(chi: Dict[str, Any]) -> None:
    """
    Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
    which is directly generated from processTomography.

    :param chi: Chi Dictionary that is obtained from processTomography
    :return: None
    """

    # setup the figure and axes
    fig = plt.figure(figsize=(12, 6))
    ax2 = fig.add_subplot(121, projection='3d')
    ax1 = fig.add_subplot(122, projection='3d')

    numX = len(chi['XLabel'])
    numY = len(chi['YLabel'])

    # fake data
    _x = numpy.arange(numX)
    _y = numpy.arange(numY)
    _xx, _yy = numpy.meshgrid(_x, _y)
    x, y = _xx.ravel(), _yy.ravel()

    top = numpy.reshape(chi['Imag'], numX * numY, )
    bottom = numpy.zeros_like(top)
    width = depth = 0.7

    # plot graph
    ax1.bar3d(x, y, bottom, width, depth, top, shade=True, color='r')
    ax1.set_xticks(numpy.linspace(0.5, numX - 0.5, numX))
    ax1.set_yticks(numpy.linspace(0.5, numY - 0.5, numY))
    ax1.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
    ax1.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
    ax1.set_title('Chi Matrix - Imaginary Parts', fontsize=18)
    ax1.set_zlim(-0.5, 0.5)
    top = numpy.reshape(chi['Real'], numX * numY, )
    bottom = numpy.zeros_like(top)

    ax2.bar3d(x, y, bottom, width, depth, top, shade=True, color='c')
    ax2.set_xticks(numpy.linspace(0.5, numX - 0.5, numX))
    ax2.set_yticks(numpy.linspace(0.5, numY - 0.5, numY))
    ax2.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
    ax2.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
    ax2.set_title('Chi Matrix - Real Parts', fontsize=18)
    ax2.set_zlim(-0.5, 0.5)
    plt.show()

    Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
    which is directly generated from processTomography.

    :param chi: Chi Dictionary that is obtained from processTomography
    :return: None
    
Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
which is directly generated from processTomography.
Generate the Process Tomography Plot in 3D . This function takes a mandatory dictionary Chi which is directly generated from processTomography .
def plotProcess(chi: Dict[str, Any]) -> None:
    fig = plt.figure(figsize=(12, 6))
    ax2 = fig.add_subplot(121, projection='3d')
    ax1 = fig.add_subplot(122, projection='3d')
    numX = len(chi['XLabel'])
    numY = len(chi['YLabel'])
    _x = numpy.arange(numX)
    _y = numpy.arange(numY)
    _xx, _yy = numpy.meshgrid(_x, _y)
    x, y = _xx.ravel(), _yy.ravel()
    top = numpy.reshape(chi['Imag'], numX * numY, )
    bottom = numpy.zeros_like(top)
    width = depth = 0.7
    ax1.bar3d(x, y, bottom, width, depth, top, shade=True, color='r')
    ax1.set_xticks(numpy.linspace(0.5, numX - 0.5, numX))
    ax1.set_yticks(numpy.linspace(0.5, numY - 0.5, numY))
    ax1.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
    ax1.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
    ax1.set_title('Chi Matrix - Imaginary Parts', fontsize=18)
    ax1.set_zlim(-0.5, 0.5)
    top = numpy.reshape(chi['Real'], numX * numY, )
    bottom = numpy.zeros_like(top)
    ax2.bar3d(x, y, bottom, width, depth, top, shade=True, color='c')
    ax2.set_xticks(numpy.linspace(0.5, numX - 0.5, numX))
    ax2.set_yticks(numpy.linspace(0.5, numY - 0.5, numY))
    ax2.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
    ax2.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
    ax2.set_title('Chi Matrix - Real Parts', fontsize=18)
    ax2.set_zlim(-0.5, 0.5)
    plt.show()
def plotProcess ( chi : Dict [ str , Any ] ) -> None : fig = plt . figure ( figsize = ( 12 , 6 ) ) ax2 = fig . add_subplot ( 121 , projection = '3d' ) ax1 = fig . add_subplot ( 122 , projection = '3d' ) numX = len ( chi [ 'XLabel' ] ) numY = len ( chi [ 'YLabel' ] ) _x = numpy . arange ( numX ) _y = numpy . arange ( numY ) _xx , _yy = numpy . meshgrid ( _x , _y ) x , y = _xx . ravel ( ) , _yy . ravel ( ) top = numpy . reshape ( chi [ 'Imag' ] , numX * numY , ) bottom = numpy . zeros_like ( top ) width = depth = 0.7 ax1 . bar3d ( x , y , bottom , width , depth , top , shade = True , color = 'r' ) ax1 . set_xticks ( numpy . linspace ( 0.5 , numX - 0.5 , numX ) ) ax1 . set_yticks ( numpy . linspace ( 0.5 , numY - 0.5 , numY ) ) ax1 . w_xaxis . set_ticklabels ( chi [ 'XLabel' ] , fontsize = 12 ) ax1 . w_yaxis . set_ticklabels ( chi [ 'YLabel' ] , fontsize = 12 ) ax1 . set_title ( 'Chi Matrix - Imaginary Parts' , fontsize = 18 ) ax1 . set_zlim ( - 0.5 , 0.5 ) top = numpy . reshape ( chi [ 'Real' ] , numX * numY , ) bottom = numpy . zeros_like ( top ) ax2 . bar3d ( x , y , bottom , width , depth , top , shade = True , color = 'c' ) ax2 . set_xticks ( numpy . linspace ( 0.5 , numX - 0.5 , numX ) ) ax2 . set_yticks ( numpy . linspace ( 0.5 , numY - 0.5 , numY ) ) ax2 . w_xaxis . set_ticklabels ( chi [ 'XLabel' ] , fontsize = 12 ) ax2 . w_yaxis . set_ticklabels ( chi [ 'YLabel' ] , fontsize = 12 ) ax2 . set_title ( 'Chi Matrix - Real Parts' , fontsize = 18 ) ax2 . set_zlim ( - 0.5 , 0.5 ) plt . show ( )
Generate the Process Tomography Plot in 3D.
Generate the Process Tomography Plot in 3D .
"""
    Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
    which is directly generated from processTomography.

    :param chi: Chi Dictionary that is obtained from processTomography
    :return: None
    """ # setup the figure and axes # fake data # plot graph
None
chi
Dict[str, Any]
Chi Dictionary that is obtained from processTomography
Chi Dictionary that is obtained from processTomography