Пример #1
0
        if j != 0:
            string += ","
        value = gv.spins.parameters()["densityMatrix"][i][j]
        string += str(real(value)) + "+I*" + str(imag(value))
    string += "}"
string += "}"
print string
##
from matplotlib.pyplot import *
from numpy import *
from pyview.lib.datacube import Datacube

cube = Datacube()
cube.loadtxt("State Tomography of Swap vs Swap Duration.txt")
##
print cube.structure()
##


def smooth(x, window_len=11, window='hanning'):
    """smooth the data using a window with requested size.
    
    This method is based on the convolution of a scaled window with the signal.
    The signal is prepared by introducing reflected copies of the signal 
    (with the window size) in both ends so that transient parts are minimized
    in the begining and end part of the output signal.
    
    input:
        x: the input signal 
        window_len: the dimension of the smoothing window; should be an odd integer
        window: the type of window from 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'
	for j in range(0,4):
		if j!=0:
			string+=","
		value = gv.spins.parameters()["densityMatrix"][i][j]
		string+=str(real(value))+"+I*"+str(imag(value))
	string+="}"
string+="}"
print string
##
from matplotlib.pyplot import *
from numpy import *
from pyview.lib.datacube import Datacube
cube = Datacube()
cube.loadtxt("State Tomography of Swap vs Swap Duration.txt")
##
print cube.structure()
##

def smooth(x,window_len=11,window='hanning'):
    """smooth the data using a window with requested size.
    
    This method is based on the convolution of a scaled window with the signal.
    The signal is prepared by introducing reflected copies of the signal 
    (with the window size) in both ends so that transient parts are minimized
    in the begining and end part of the output signal.
    
    input:
        x: the input signal 
        window_len: the dimension of the smoothing window; should be an odd integer
        window: the type of window from 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'
            flat window will produce a moving average smoothing.