-
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.
Creating scaffolding for the Stern Gerlach experiments, see #53
- Loading branch information
1 parent
7deaa9b
commit 2b7c513
Showing
4 changed files
with
195 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* SpinExperiments contains the details for all posisble Stern-Gerlach configurations of the Spin Screen. | ||
* | ||
* // TODO: So far basing off OrbitalSystem.ts https://github.com/phetsims/quantum-measurement/issues/53 | ||
* | ||
* @author Agustín Vallejo | ||
*/ | ||
|
||
import TReadOnlyProperty from '../../../../axon/js/TReadOnlyProperty.js'; | ||
import Enumeration from '../../../../phet-core/js/Enumeration.js'; | ||
import EnumerationValue from '../../../../phet-core/js/EnumerationValue.js'; | ||
import quantumMeasurement from '../../quantumMeasurement.js'; | ||
|
||
|
||
type SternGerlachOptions = { | ||
isZOriented: boolean; | ||
active: boolean; | ||
}; | ||
|
||
export default class SpinExperiments extends EnumerationValue { | ||
|
||
public static readonly EXPERIMENT_1 = new SpinExperiments( 'Experiment 1 [SGz]', [ | ||
{ isZOriented: true, active: true } | ||
] ); | ||
public static readonly EXPERIMENT_2 = new SpinExperiments( 'Experiment 2 [SGx]', [ | ||
{ isZOriented: false, active: true } | ||
] ); | ||
public static readonly EXPERIMENT_3 = new SpinExperiments( 'Experiment 3 [Sz, Sx]', [ | ||
{ isZOriented: true, active: true }, | ||
{ isZOriented: false, active: true } | ||
] ); | ||
public static readonly EXPERIMENT_4 = new SpinExperiments( 'Experiment 4 [Sz, Sz]', [ | ||
{ isZOriented: true, active: true }, | ||
{ isZOriented: true, active: true } | ||
] ); | ||
public static readonly EXPERIMENT_5 = new SpinExperiments( 'Experiment 5 [Sx, Sz]', [ | ||
{ isZOriented: false, active: true }, | ||
{ isZOriented: true, active: true } | ||
] ); | ||
public static readonly EXPERIMENT_6 = new SpinExperiments( 'Experiment 6 [Sx, Sx]', [ | ||
{ isZOriented: false, active: true }, | ||
{ isZOriented: false, active: true } | ||
] ); | ||
public static readonly CUSTOM = new SpinExperiments( 'Custom', [ | ||
{ isZOriented: false, active: false }, | ||
{ isZOriented: false, active: false } | ||
] ); | ||
|
||
public static readonly enumeration = new Enumeration( SpinExperiments ); | ||
|
||
public readonly experimentName: string | TReadOnlyProperty<string>; | ||
|
||
public readonly experimentSettings: SternGerlachOptions[]; | ||
|
||
public constructor( experimentName: string | TReadOnlyProperty<string>, experimentSettings: SternGerlachOptions[] ) { | ||
super(); | ||
this.experimentName = experimentName; | ||
this.experimentSettings = experimentSettings; | ||
} | ||
} | ||
|
||
quantumMeasurement.register( 'SpinExperiments', SpinExperiments ); |
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,40 @@ | ||
// Copyright 2024, University of Colorado Boulder | ||
|
||
/** | ||
* SternGerlachModel handles the internal states of the Stern Gerlach experiment. This includes: | ||
* - The direction of the experiment (currently constrained to X and +-Z) | ||
* - The state of the incoming particles | ||
* - The state of the particles after the experiment | ||
* | ||
* @author Agustín Vallejo | ||
*/ | ||
|
||
import BooleanProperty from '../../../../axon/js/BooleanProperty.js'; | ||
import Tandem from '../../../../tandem/js/Tandem.js'; | ||
import quantumMeasurement from '../../quantumMeasurement.js'; | ||
|
||
export default class SternGerlachModel { | ||
|
||
public readonly isZOrientedProperty: BooleanProperty; | ||
|
||
public readonly isVisibleProperty: BooleanProperty; | ||
|
||
public constructor( isZOriented: boolean, tandem: Tandem ) { | ||
|
||
this.isZOrientedProperty = new BooleanProperty( isZOriented, { | ||
tandem: tandem.createTandem( 'isZOrientedProperty' ) | ||
} ); | ||
|
||
this.isVisibleProperty = new BooleanProperty( true, { | ||
tandem: tandem.createTandem( 'isVisibleProperty' ) | ||
} ); | ||
|
||
} | ||
|
||
public reset(): void { | ||
// no-op TODO https://github.com/phetsims/quantum-measurement/issues/53 | ||
} | ||
|
||
} | ||
|
||
quantumMeasurement.register( 'SternGerlachModel', SternGerlachModel ); |
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