Skip to content

Commit

Permalink
Reverse factor 1/2 in transmon_interaction (#4478)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qottmann committed Aug 15, 2023
1 parent 975b0c3 commit e93fc1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ array([False, False])
* Updated `expand_fn()` for `DefaultQubit2` to decompose `StatePrep` operations present in the middle of a circuit.
[(#4444)](https://github.com/PennyLaneAI/pennylane/pull/4444)

* `transmon_drive` is updated in accordance with [1904.06560](https://arxiv.org/abs/1904.06560). In particular, the functional form has been changed from $\Omega(t)(\cos(\omega_d t + \phi) X - \sin(\omega_d t + \phi) Y)$ to $\Omega(t) \sin(\omega_d t + \phi) Y$. Furthermore, qubit frequencies in `transmon_interaction` are now divided by 2 as is common as well.
* `transmon_drive` is updated in accordance with [1904.06560](https://arxiv.org/abs/1904.06560). In particular, the functional form has been changed from $\Omega(t)(\cos(\omega_d t + \phi) X - \sin(\omega_d t + \phi) Y)$ to $\Omega(t) \sin(\omega_d t + \phi) Y$.
[(#4418)](https://github.com/PennyLaneAI/pennylane/pull/4418/)
[(#4465)](https://github.com/PennyLaneAI/pennylane/pull/4465/)
[(#4478)](https://github.com/PennyLaneAI/pennylane/pull/4478/)

<h3>Breaking changes 💔</h3>

Expand Down
4 changes: 2 additions & 2 deletions pennylane/pulse/transmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def transmon_interaction(
.. math::
H = \sum_{q\in \text{wires}} \frac{\omega_q}{2} b^\dagger_q b_q
H = \sum_{q\in \text{wires}} \omega_q b^\dagger_q b_q
+ \sum_{(i, j) \in \mathcal{C}} g_{ij} \left(b^\dagger_i b_j + b_j^\dagger b_i \right)
+ \sum_{q\in \text{wires}} \alpha_q b^\dagger_q b^\dagger_q b_q b_q
Expand Down Expand Up @@ -179,7 +179,7 @@ def transmon_interaction(

# qubit term
coeffs = list(omega)
observables = [qml.s_prod(0.5, ad(i, d) @ a(i, d)) for i in wires]
observables = [ad(i, d) @ a(i, d) for i in wires]

# coupling term
coeffs += list(g)
Expand Down
4 changes: 2 additions & 2 deletions tests/pulse/test_transmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def test_float_qubit_freq_with_explicit_wires(self):
g = 2 * np.pi * coupling
assert H.coeffs[:6] == [2 * np.pi] * 6
assert all(H.coeffs[6:] == g)
for o1, o2 in zip(H.ops[:6], [qml.s_prod(0.5, ad(i, 2) @ a(i, 2)) for i in wires]):
for o1, o2 in zip(H.ops[:6], [ad(i, 2) @ a(i, 2) for i in wires]):
assert qml.equal(o1, o2)

def test_single_callable_qubit_freq_with_explicit_wires(self):
Expand All @@ -377,7 +377,7 @@ def test_single_callable_qubit_freq_with_explicit_wires(self):
assert qml.math.allclose(H.coeffs[:10], g)
for coeff in H.coeffs[10:]:
assert coeff([3, 4, 5], 6) == omega([3, 4, 5], 6)
for o1, o2 in zip(H.ops[10:], [qml.s_prod(0.5, ad(i, 2) @ a(i, 2)) for i in wires0]):
for o1, o2 in zip(H.ops[10:], [ad(i, 2) @ a(i, 2) for i in wires0]):
assert qml.equal(o1, o2)

def test_d_neq_2_raises_error(self):
Expand Down

0 comments on commit e93fc1b

Please sign in to comment.