-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the direction combo box, see #54
- Loading branch information
1 parent
186531c
commit 605eed8
Showing
4 changed files
with
80 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* Represents the possible preset directions the state vector within the Bloch Sphere can have. | ||
* | ||
* @author Agustín Vallejo | ||
*/ | ||
|
||
import Enumeration from '../../../../phet-core/js/Enumeration.js'; | ||
import EnumerationValue from '../../../../phet-core/js/EnumerationValue.js'; | ||
import quantumMeasurement from '../../quantumMeasurement.js'; | ||
|
||
export class StateDirection extends EnumerationValue { | ||
public static readonly Z_PLUS = new StateDirection( '+Z', 0, 0, 'ZPlus' ); | ||
public static readonly Z_MINUS = new StateDirection( '-Z', Math.PI, 0, 'ZMinus' ); | ||
public static readonly X_PLUS = new StateDirection( '+X', Math.PI / 2, 0, 'XPlus' ); | ||
public static readonly X_MINUS = new StateDirection( '-X', Math.PI / 2, Math.PI, 'XMinus' ); | ||
public static readonly Y_PLUS = new StateDirection( '+Y', Math.PI / 2, Math.PI / 2, 'YPlus' ); | ||
public static readonly Y_MINUS = new StateDirection( '-Y', Math.PI / 2, 3 * Math.PI / 2, 'YMinus' ); | ||
public static readonly CUSTOM = new StateDirection( 'Custom', 0, 0, 'Custom' ); | ||
|
||
public static readonly enumeration = new Enumeration( StateDirection ); | ||
|
||
public constructor( public readonly description: string, | ||
public readonly polarAngle: number, | ||
public readonly azimuthalAngle: number, | ||
public readonly tandemName: string ) { | ||
super(); | ||
} | ||
} | ||
|
||
quantumMeasurement.register( 'StateDirection', StateDirection ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters