Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data structures for specifying input states #770

Merged
merged 31 commits into from
Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Changelog
v2.4 (Development)
------------------

- Operator estimation data structures introduced in v2.2 have changed. ExperimentSetting's had
two members: in_operator and out_operator. out_operator is unchanged. in_operator has been
renamed to in_state and its data type is now ``TensorProductState`` instead of ``PauliTerm``.
It was always an abuse of notation to interpret pauli operators as defining initial states.
Analogous to the Pauli helper functions sI, sX, sY, and sZ, TensorProductStates are constructed
by multiplying together terms generated by the helper functions plusX, minusX, plusY, minusY,
plusZ, minusZ, and vacuum. This functionality enables process tomography and process DFE (gh-770).


v2.3 (January 28, 2019)
-----------------------
Expand Down
29 changes: 28 additions & 1 deletion pyquil/gate_matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,33 @@ def bitphase_flip_operators(p):
'bitphase_flip': bitphase_flip_operators,
}

SIC0 = np.array([1, 0])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a reference so people can check?

I personally use this http://info.phys.unm.edu/~caves/reports/infopovm.pdf see Eqns. 22 and 23

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool; I'll add that in

SIC1 = np.array([1, np.sqrt(2)]) / np.sqrt(3)
SIC2 = np.array([1, np.exp(-np.pi * 2j / 3) * np.sqrt(2)]) / np.sqrt(3)
SIC3 = np.array([1, np.exp(np.pi * 2j / 3) * np.sqrt(2)]) / np.sqrt(3)

STATES = {
'X': [
np.array([1, 1]) / np.sqrt(2),
np.array([1, -1]) / np.sqrt(2),
],
'Y': [
np.array([1, 1j]) / np.sqrt(2),
np.array([1, -1j]) / np.sqrt(2),
],
'Z': [
np.array([1, 0]),
np.array([0, 1]),
],
'SIC': [
SIC0,
SIC1,
SIC2,
SIC3,
]
}

__all__ = list(QUANTUM_GATES.keys()) + ['relaxation_operators', 'dephasing_operators',
'depolarizing_operators', 'phase_flip_operators',
'bit_flip_operators', 'bitphase_flip_operators']
'bit_flip_operators', 'bitphase_flip_operators',
'SIC_BASIS', 'SIC0', 'SIC1', 'SIC2', 'SIC3']
Loading