Skip to content

Commit

Permalink
Merge pull request #83 from pasqal-io/remove-ryd2
Browse files Browse the repository at this point in the history
Removing "rydberg_local2" from Chadoq2
  • Loading branch information
HGSilveri authored Feb 10, 2021
2 parents 9b4338a + 22c55f9 commit d7d59b2
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 54 deletions.
27 changes: 15 additions & 12 deletions docs/source/introduction_rydberg_blockade.ipynb

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion pulser/devices/_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
_channels=(
("rydberg_global", Rydberg.Global(2 * np.pi * 20, 2 * np.pi * 2.5)),
("rydberg_local", Rydberg.Local(2 * np.pi * 20, 2 * np.pi * 10)),
("rydberg_local2", Rydberg.Local(2 * np.pi * 20, 2 * np.pi * 10)),
("raman_local", Raman.Local(2 * np.pi * 20, 2 * np.pi * 10)),
),
)
1 change: 0 additions & 1 deletion pulser/tests/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def test_sequence():
seq.declare_channel('ch0', 'raman_local', initial_target='q0')
seq.declare_channel('ch1', 'rydberg_local', initial_target='q0')
seq.declare_channel('ch2', 'rydberg_global')
seq.declare_channel('ch3', 'rydberg_local2')
seq.phase_shift(np.pi, 'q0', basis='ground-rydberg')

pulse1 = Pulse.ConstantPulse(500, 2, -10, 0, post_phase_shift=np.pi)
Expand Down
33 changes: 12 additions & 21 deletions pulser/tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,32 @@
seq = Sequence(reg, Chadoq2)

# Declare Channels
seq.declare_channel('rydA', 'rydberg_local', 'control1')
seq.declare_channel('rydB', 'rydberg_local2', 'control2')
seq.declare_channel('ryd', 'rydberg_local', 'control1')
seq.declare_channel('raman', 'raman_local', 'control1')

d = 0 # Pulse Duration

# Prepare state 'hhh':
seq.add(pi_Y, 'raman')
d += 1
seq.target('target', 'raman')
seq.add(pi_Y, 'raman')
d += 1
seq.target('control2', 'raman')
seq.add(pi_Y, 'raman')
d += 1
d += 3

prep_state = qutip.tensor([qutip.basis(3, 2) for _ in range(3)])

# Write CCZ sequence:
seq.add(pi, 'rydA', 'wait-for-all') # Wait for state preparation to finish.
d += 1
seq.align('rydA', 'rydB')
seq.add(pi, 'rydB')
d += 1
seq.target('target', 'rydA')
seq.align('rydA', 'rydB')
seq.add(twopi, 'rydA')
d += 1
seq.align('rydA', 'rydB')
seq.add(pi, 'rydB')
d += 1
seq.target('control1', 'rydA')
seq.align('rydA', 'rydB')
seq.add(pi, 'rydA')
d += 1
seq.add(pi, 'ryd', protocol='wait-for-all')
seq.target('control2', 'ryd')
seq.add(pi, 'ryd')
seq.target('target', 'ryd')
seq.add(twopi, 'ryd')
seq.target('control2', 'ryd')
seq.add(pi, 'ryd')
seq.target('control1', 'ryd')
seq.add(pi, 'ryd')
d += 5


def test_initialization_and_construction_of_hamiltonian():
Expand Down
3 changes: 0 additions & 3 deletions tutorials/applications/Control-Z Gate Sequence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@
" \n",
" # Declare Rydberg channel\n",
" seq.declare_channel('ryd', 'rydberg_local', 'control')\n",
" #seq.declare_channel('ryd_target', 'rydberg_local2', 'target')\n",
" \n",
" # Write CZ sequence:\n",
" seq.add(pi_pulse, 'ryd', 'wait-for-all') # Wait for state preparation to finish.\n",
Expand Down Expand Up @@ -606,7 +605,6 @@
" \n",
" # Declare Rydberg channel\n",
" seq.declare_channel('ryd', 'rydberg_local', 'control1')\n",
" #seq.declare_channel('rydB', 'rydberg_local2', 'control2')\n",
" \n",
" # Write CZ sequence:\n",
" seq.add(pi_pulse, 'ryd', protocol='wait-for-all') # Wait for state preparation to finish.\n",
Expand Down Expand Up @@ -769,7 +767,6 @@
" final_st = res.states[-1]\n",
" CCZ[state_id] = final_st.overlap(prep_state)\n",
" \n",
" #plt.plot(np.imag(data))\n",
" plt.figure()\n",
" plt.plot(np.real(data))\n",
" plt.xlabel(r\"Time [ns]\")\n",
Expand Down
22 changes: 11 additions & 11 deletions tutorials/composition/Phase Shifts and Virtual Z gates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"source": [
"import numpy as np\n",
"from pulser import Pulse, Sequence, Register\n",
"from pulser.devices import Chadoq2"
"from pulser.devices import MockDevice"
]
},
{
Expand Down Expand Up @@ -126,10 +126,10 @@
{
"data": {
"text/plain": [
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 15.707963267948966 rad/µs, Basis: 'ground-rydberg'),\n",
" 'rydberg_local': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'rydberg_local2': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'raman_local': Raman.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'digital')}"
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Basis: 'ground-rydberg'),\n",
" 'rydberg_local': Rydberg.Local(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Target time: 0 ns, Max targets: 2000, Basis: 'ground-rydberg'),\n",
" 'raman_global': Raman.Global(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Basis: 'digital'),\n",
" 'raman_local': Raman.Local(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Target time: 0 ns, Max targets: 2000, Basis: 'digital')}"
]
},
"execution_count": 2,
Expand All @@ -139,7 +139,7 @@
],
"source": [
"reg = Register({'q0': (0, 0)})\n",
"device = Chadoq2\n",
"device = MockDevice\n",
"seq = Sequence(reg, device)\n",
"seq.available_channels"
]
Expand Down Expand Up @@ -355,9 +355,9 @@
{
"data": {
"text/plain": [
"{'raman': Raman.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'digital'),\n",
" 'ryd1': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'ryd2': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg')}"
"{'raman': Raman.Local(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Target time: 0 ns, Max targets: 2000, Basis: 'digital'),\n",
" 'ryd1': Rydberg.Local(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Target time: 0 ns, Max targets: 2000, Basis: 'ground-rydberg'),\n",
" 'ryd2': Rydberg.Local(Max Absolute Detuning: 1000 rad/µs, Max Amplitude: 200 rad/µs, Target time: 0 ns, Max targets: 2000, Basis: 'ground-rydberg')}"
]
},
"execution_count": 10,
Expand All @@ -367,11 +367,11 @@
],
"source": [
"reg = Register({'q0': (0, 0), 'q1': (5, 5)})\n",
"device = Chadoq2\n",
"device = MockDevice\n",
"seq = Sequence(reg, device)\n",
"seq.declare_channel('raman', 'raman_local', initial_target = 'q0')\n",
"seq.declare_channel('ryd1', 'rydberg_local', initial_target = 'q0')\n",
"seq.declare_channel('ryd2', 'rydberg_local2', initial_target = 'q0')\n",
"seq.declare_channel('ryd2', 'rydberg_local', initial_target = 'q0')\n",
"seq.declared_channels"
]
},
Expand Down
7 changes: 2 additions & 5 deletions tutorials/creating_sequences.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@
"text/plain": [
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 15.707963267948966 rad/µs, Basis: 'ground-rydberg'),\n",
" 'rydberg_local': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'rydberg_local2': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'raman_local': Raman.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'digital')}"
]
},
Expand Down Expand Up @@ -258,12 +257,10 @@
"text": [
"Available channels after declaring 'ch0':\n",
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 15.707963267948966 rad/µs, Basis: 'ground-rydberg'),\n",
" 'rydberg_local': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg'),\n",
" 'rydberg_local2': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg')}\n",
" 'rydberg_local': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg')}\n",
"\n",
"Available channels after declaring 'ch1':\n",
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 15.707963267948966 rad/µs, Basis: 'ground-rydberg'),\n",
" 'rydberg_local2': Rydberg.Local(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 62.83185307179586 rad/µs, Target time: 220 ns, Basis: 'ground-rydberg')}\n"
"{'rydberg_global': Rydberg.Global(Max Absolute Detuning: 125.66370614359172 rad/µs, Max Amplitude: 15.707963267948966 rad/µs, Basis: 'ground-rydberg')}\n"
]
}
],
Expand Down

0 comments on commit d7d59b2

Please sign in to comment.