Пример #1
0
        def __init__(self, fig):
            """
            Initialize all propagators and frame
            :param fig: matplotlib figure object
            """
            #  Initialize the system
            self.set_sys()

            #################################################################
            #
            # Initialize plotting facility
            #
            #################################################################

            self.fig = fig

            # import utility to visualize the wigner function
            from wigner_normalize import WignerNormalize, WignerSymLogNorm

            img_params = dict(
                extent=[
                    self.quant_sys.X.min(),
                    self.quant_sys.X.max(),
                    self.quant_sys.P.min(),
                    self.quant_sys.P.max()
                ],
                origin='lower',
                cmap='seismic',
                norm=WignerNormalize(vmin=-0.01, vmax=0.1)
                #norm=WignerSymLogNorm(linthresh=1e-16, vmin=-0.01, vmax=0.1)
            )

            ax = fig.add_subplot(121)
            ax.set_title('Quantum classical hybrid, $\\Upsilon_1(x,p,t)$')

            # generate empty plots
            self.img_Upsilon1 = ax.imshow([[]], **img_params)

            ax.set_xlabel('$x$ (a.u.)')
            ax.set_ylabel('$p$ (a.u.)')

            ax = fig.add_subplot(122)
            ax.set_title('Quantum classical hybrid, $\\Upsilon_2(x,p,t)$')

            # generate empty plots
            self.img_Upsilon2 = ax.imshow([[]], **img_params)

            ax.set_xlabel('$x$ (a.u.)')
            ax.set_ylabel('$p$ (a.u.)')