-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add walkthrough, demos, time step/total time, style tweaks
- Loading branch information
1 parent
35c18cd
commit 27d4adf
Showing
11 changed files
with
268 additions
and
63 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
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,61 @@ | ||
#demo-modal { | ||
position: absolute; | ||
top: 0; | ||
width: 100vw; | ||
height: calc(100vh - 40px); | ||
background: #1d1d1d; | ||
border: 1px solid white; | ||
color: white; | ||
font-family: monospace; | ||
padding: 20px 20px 80px 20px; | ||
} | ||
|
||
.button-group { | ||
position: absolute; | ||
bottom: 20px; | ||
right: 20px; | ||
} | ||
|
||
.button-group > button { | ||
width: 100px; | ||
height: 35px; | ||
cursor: pointer; | ||
} | ||
|
||
.button-group > button + button { | ||
margin-left: 20px; | ||
} | ||
|
||
.step-counter { | ||
position: absolute; | ||
top: 15px; | ||
right: 15px; | ||
} | ||
|
||
p { | ||
font-size: 16px; | ||
margin: 10px 0; | ||
} | ||
|
||
#demos { | ||
position: absolute; | ||
top: 10px; | ||
left: 50%; | ||
transform: translate(-50%); | ||
border-radius: 5px; | ||
} | ||
|
||
#demos > select { | ||
padding: 10px 20px; | ||
background: black; | ||
border: 1px solid white; | ||
border-radius: 5px; | ||
} | ||
|
||
#demos > button { | ||
padding: 10px 15px; | ||
background: black; | ||
border: 1px solid white; | ||
border-radius: 100px; | ||
cursor: pointer; | ||
} |
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,100 @@ | ||
import './Demo.css'; | ||
|
||
import React, { useState } from 'react'; | ||
|
||
export default function DemoModal({ onExit, setTab }) { | ||
const [step, setStep] = useState(0) | ||
const nextStep = () => setStep(step => step + 1) | ||
const prevStep = () => setStep(step => step - 1) | ||
|
||
const steps = [ | ||
Step1, | ||
LabStep, | ||
DetailStep, | ||
ResultsStep, | ||
TabsStep, | ||
] | ||
const StepComponent = steps[step] | ||
|
||
return <div id="demo-modal"> | ||
<StepComponent /> | ||
<div className="step-counter">{`(${step + 1}/${steps.length})`}</div> | ||
<div className="button-group"> | ||
{step > 0 && <button onClick={prevStep}>Back</button>} | ||
{step < steps.length - 1 ? <button onClick={nextStep}>Next</button> : <button onClick={onExit}>Finish</button>} | ||
<button onClick={onExit}>Exit</button> | ||
</div> | ||
</div> | ||
} | ||
|
||
const Step1 = () => { | ||
return ( | ||
<> | ||
<h1>{`What is this?`}</h1> | ||
<p> | ||
Welcome to the <b>QuTiP Virtual Lab</b> | ||
</p> | ||
<p>This application shows how QuTiP can simulate quantum systems</p> | ||
<p>This modal will guide you through the application</p> | ||
<p>Hit Next to continue</p> | ||
</> | ||
) | ||
} | ||
|
||
const LabStep = () => { | ||
return ( | ||
<> | ||
<h1>Laboratory</h1> | ||
<img src="" /> | ||
<p> | ||
Tapping on any 'Add Qubit' will get you started. | ||
Once added, you can tap the qubit to toggle the menu. | ||
</p> | ||
<img /> | ||
<p>You can add control lasers, interactions between qubits, and model heat baths from this menu</p> | ||
</> | ||
) | ||
} | ||
|
||
const DetailStep = () => { | ||
return ( | ||
<> | ||
<h1>Details</h1> | ||
<img src="" /> | ||
<p> | ||
Here you can see the equations describing the Laboratory model. | ||
You can tune the parameters that govern the lasers, interactions, and heat baths. | ||
</p> | ||
<p> | ||
You can also tweak the simulation parameters for the time step and total time. | ||
</p> | ||
<p>Once you have set up your system, click on the</p> | ||
<button id="submit">Simulate ▶️</button> | ||
<p>to simulate the system using QuTiP</p> | ||
</> | ||
) | ||
} | ||
|
||
const ResultsStep = () => { | ||
return ( | ||
<> | ||
<h1>Results</h1> | ||
<p>Here you can see the output from QuTiP</p> | ||
<p>You can see how the expectation values of the spin vectors for each qubit evolve over time</p> | ||
<p>The evolution is plotted on the Bloch sphere</p> | ||
<p>You can also rotate the Bloch sphere</p> | ||
<p>Drag the slider at the bottom to view the system at a specific point in time</p> | ||
</> | ||
) | ||
} | ||
|
||
const TabsStep = () => { | ||
return ( | ||
<> | ||
<h1>Other Controls</h1> | ||
<p>The <span className='tab-button'>⤢</span> will toggle fullscreen mode</p> | ||
<p>The <span className='tab-button'>?</span> will toggle this modal</p> | ||
<p>The <span className='tab-button'>⚛</span> will allow you to select an example system. Try it!</p> | ||
</> | ||
) | ||
} |
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
Oops, something went wrong.