コード例 #1
0
from PyQuantum.Tools.MkDir import *
from PyQuantum.Tools.CSV import *
# ---------------------------------------------------------------------------------------------------------------------
# PyQuantum.Common
from PyQuantum.Common.Quantum.Operators import operator_a
# ---------------------------------------------------------------------------------------------------------------------
config.capacity = 2
config.n_atoms = 2

cavity = Cavity(config.wc, config.wa, config.g, config.n_atoms)

cavity.info()

H = Hamiltonian(config.capacity, cavity)

s_2 = WaveFunction(states=H.states, init_state=[1, [0, 1]], amplitude=1./sqrt(2)) - \
    WaveFunction(states=H.states, init_state=[1, [1, 0]], amplitude=1./sqrt(2))

t_0 = WaveFunction(states=H.states, init_state=[1, [0, 0]])
# ---------------------------------------------------------------------------------------------------------------------
for coeff in np.arange(4.00, 6.01, 1.00):
    config.l = config.g * coeff
    config.dt = (0.01 / config.l)

    path = 'M_' + str(np.round(coeff, 3))
    print(path)
    mkdir('MM/' + path)

    for w_0 in [
        {
            'name': 't_0',
コード例 #2
0
def get_w0_1_D(H_1_D):
    return \
        WaveFunction(states=H_1_D.states, init_state=[1, [0, 1]], amplitude=1./sqrt(2)) - \
        WaveFunction(states=H_1_D.states, init_state=[
                     1, [1, 0]], amplitude=1./sqrt(2))
コード例 #3
0
# exit(0)

cavity.info()
# ---------------------------------------------------------------------------------------------------------------------
# H = Hamiltonian(config.capacity, cavity)
H = Hml(config.capacity, cavity)


# H.print()
# print(len(H.states), np.shape(H.matrix.data), type(H.matrix.data),
#       H.matrix.data.getnnz(), '/', np.shape(H.matrix.data)[0]*np.shape(H.matrix.data)[1])
# exit(0)
# ---------------------------------------------------------------------------------------------------------------------
# print(config.init_state)

w_0 = WaveFunction(states=H.states, init_state=config.init_state)
# ---------------------------------------------------------------------------------------------------------------------
ro_0 = DensityMatrix(w_0)

# ro_0.print()
# ---------------------------------------------------------------------------------------------------------------------
sink_list = []
T_list = []

run({
    "ro_0": ro_0,
    "H": H,
    "T": config.T,
    "dt": config.dt,
    "nt": config.nt,
    "l": config.l,
コード例 #4
0
def get_w0_1_00(H_1_00):
    return WaveFunction(
        states=H_1_00.states,
        init_state=[1, [0, 0]]
    )