In [3]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import configure_matplotlib
import qca
print('QCA version: ' + qca.__version__)
QCA version: 8.2.0
In [14]:
# increases the resolution of the pngs displayed inline, 
# so they are big enough even for a small figsize
%matplotlib inline
c = %config InlineBackend.rc
c['savefig.dpi'] = 150
%config InlineBackend.figure_format='png'
%config InlineBackend.rc = c
%matplotlib inline

configure_matplotlib.configure_matplotlib()
In [15]:
def P(P_D):
    s = qca.QcaFixedCharge()
    s.q = 0.5
    s.t = 1
    s.V0 = 1E6
    s.T = 1E-6
    s.l = qca.Wire(1,100,2,P_D)
    s.init()
    s.run()
    return s.results['P'][0]

P_Ds = np.linspace(-1,1,100);
Ps = np.array([P(P_D) for P_D in P_Ds])
In [17]:
fig, p = plt.subplots(1,1,figsize=(4.4,4.4 * 3.0/4.0))
p.plot(P_Ds, Ps)
p.set_xlabel('driver polarization')
p.set_ylabel('cell polarization')
fig.savefig('../gfx/chapter01/cell_cell_response_plot.svg')
In [18]:
Ps = [1,0.90,0.88,0.88,0.88,0.88,0.8]
fig, p = plt.subplots(1,1,figsize=(4.4,4.4 * 2.0/4.0))
p.plot(Ps)
p.set_ylim((0.5,1))
p.set_xlabel('cell number')
p.set_ylabel('cell polarization')
fig.savefig('../gfx/chapter01/icha_wire_pseudo_plot.svg')
In [4]: