当前位置: 首页>>代码示例>>Python>>正文


Python Datacube.children方法代码示例

本文整理汇总了Python中pyview.lib.datacube.Datacube.children方法的典型用法代码示例。如果您正苦于以下问题:Python Datacube.children方法的具体用法?Python Datacube.children怎么用?Python Datacube.children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyview.lib.datacube.Datacube的用法示例。


在下文中一共展示了Datacube.children方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Datacube

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import children [as 别名]
titleString = "2 Qubit Anticrossing"
outputFilename = "anticrossing"
dataFile = r"data/Spectroscopy Survey - qubit1-7.txt"

print "Loading data..."

datacube = Datacube()
datacube.loadtxt(dataFile)

##

from numpy import *
from numpy.linalg import *

m1 = zeros((len(datacube.children()[0]),len(datacube)))
m2 = zeros((len(datacube.children()[0]),len(datacube)))

for i,child in enumerate(datacube.children()):
	m1[:,i] = child["p1x"] 
	m2[:,i] = child["px1"] 

##Generate a model of the qubit anticrossing

def tensor(a,b):
	return kron(b,a)

idatom = matrix(eye(2))

H_1 = lambda f1:tensor(matrix([[-f1/2.,0],[0,f1/2.]]),idatom)
H_2 = lambda f2:tensor(idatom,matrix([[-f2/2.,0],[0,f2/2.]]))
开发者ID:adewes,项目名称:phd-thesis-physics,代码行数:32,代码来源:plot_anticrossing.py

示例2: len

# 需要导入模块: from pyview.lib.datacube import Datacube [as 别名]
# 或者: from pyview.lib.datacube.Datacube import children [as 别名]
		i+=2
		if i >= len(lines):	
			break
		curve = Datacube("l1 = %g nH" % lq)
		curves.addChild(curve,lq = lq)
		curve.parameters()["defaultPlot"] = [("freq","mag")]
	elif len(elements) == 2:
		(freq,mag) = map(lambda x:float(x),lines[i].split(","))
		curve.set(freq = freq,mag = mag)
		curve.commit()
	i+=1	
curves.savetxt("sonnet_model")
##
import os
from numpy import *
m = zeros((len(curves.children()[0]),len(curves.children())))
i = 0
for child in curves.children():
	print mean(child["mag"]),max(child["mag"])
	m[:,i] = child["mag"]
	i+=1
m = m [::-1]
figure(10)
clf()
hsv()
imshow(m,aspect = 'auto',interpolation = 'bilinear',extent = (curves.attributesOfChild(curves.children()[0])["lq"],curves.attributesOfChild(curves.children()[-1])["lq"],child["freq"][0],child["freq"][-1]))
ticklabel_format(style = 'plain',axis = 'y',useOffset = False)
#figtext(0.1,0.95,os.getcwd()+"/"+filename,size = 7)
#ylim(11,12)
#xlim(2,2.3)
xlabel("$L_{qb}$ [nH]")
开发者ID:adewes,项目名称:phd-thesis-physics,代码行数:33,代码来源:analyze_sonnet_data.py


注:本文中的pyview.lib.datacube.Datacube.children方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。