我正在将Jupyter Notebook与Interactive.jl / Reactive.jl结合使用。
当我在滑块上使用@manipulate后,重新运行代码块,我看到这些信息/警告信息以红色突出显示:
[Input{Int64}] 180
[Input{Int64}] 210
[Input{Int64}] 255
[Input{Int64}] 180
[Input{Int64}] 210
[Input{Int64}] 135
了解导致这些消息的原因是什么?如何抑制它们?
我使用的具体代码是
function complex_round(complex_number,digits_after_comma)
return round(real(complex_number),digits_after_comma) + round(imag(complex_number),digits_after_comma)*im
end
@manipulate for θ in 0:15:360, ϕ in 0:15:360 # let us manipulate the value of θ
psi = [cosd(θ/2),e^(2*pi*im*ϕ/360)*sind(θ/2)]
rho = complex_round(kron(psi',psi),3)
psi = complex_round(psi,3)
# Some very annoying hack required to make the print
# I will look into Compose/Cairo.
text = Array(Any,(2,6))
# text[row,column]
text[1,1] = "psi"
text[2,1] = "="
text[1:2,2] = psi
text[1,3] = "|"
text[2,3] = "|"
text[1,4] = "rho"
text[2,4] = "="
text[1:2,5:6] = rho
text
end
非常感谢帮助!