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

Created generalized_stabilizer_state.py #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AbdullahKazi500
Copy link

@AbdullahKazi500 AbdullahKazi500 commented Jun 12, 2024

This pull request introduces a new class GeneralizedStabilizerState designed to represent quantum states using the Generalized Stabilizer Formalism (GSF). The class supports both Clifford and non-Clifford gates, enabling the manipulation and measurement of quantum states .

Implements methods for applying single-qubit gates (H, X, Y, Z) and two-qubit gates (CNOT).
Includes functionality for applying Clifford maps and performing qubit measurements.
Facilitates state manipulation and entanglement property computations without external dependencies.

The class maintains attributes such as num_qubits, stabilizers, and phase to represent the quantum state.
Methods like apply_clifford_map, apply_single_qubit_gate, apply_two_qubit_gate, measure, and str are implemented to handle state operations

fixes #25

@AbdullahKazi500
Copy link
Author

Hi @hongyehu made a PR Fixing #25 let me know the review

@AbdullahKazi500
Copy link
Author

@hongyehu Hi
added destabilizers to the class to store the destabilizer states.
updated the apply_gate method to handle the CNOT gate by modifying both stabilizers and destabilizers.
updated the _apply_hadamard, _apply_phase, _apply_controlled_z, and _apply_cnot methods to transform both stabilizers and destabilizers appropriately.
The str method now prints both stabilizers and destabilizers for a complete view of the state.

Copy link
Author

@AbdullahKazi500 AbdullahKazi500 left a comment

Choose a reason for hiding this comment

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

for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Unitary Hack]Implementation of generalized stabilizer state
1 participant