A writing prompt generator for the Gotham Writers Workshop game show
This tool randomly generates a story prompt by making use of quantum computing.
An online version is provided at promptgen.herokuapp.com. This version runs only on the QASM simulator so that the server is not overloaded.
Click on ‘Refresh’ to generate a new prompt. If the same prompt shows up a number of times, don't worry! This can happen due to cache. Simply click Refresh until you get a new one!
If you want to run it on a actual quantum device, or just have a local copy of this follow the following step:
- Clone the git repository from Github.
cd
into the git repository.- Execute
pip install -r requirements.txt
. - Execute
export FLASK_APP=app.py
- Execute
flask run
The app will available at 127.0.0.1:5000/
. You can direct your browser to that location to access it. To run this on an actual quantum device, open app.py
and edit it as mentioned in the comments in the file, before executing flask run
.
A prompt is randomly generated by tapping into two phrase banks: CHARACTER and SITUATION. Each prompt takes the form:
A <CHARACTER> who <SITUATION>.
For instance, if "grocery store cashier" cashier is pulled from the CHRACTER bank, and "is cut off from family inheritance" is pulled from the SITUATION bank, then the generated prompt becomes:
A grocery store cashier who is cut off from family inheritance.
Random selection takes place through quantum computing.
Quantum computing is used to randomly select phrases from the phrase banks.
If a choice needs to be made from among eight word options, say, then a circuit of three qubits is prepared. A Hadamard gate is applied on each qubit, placing them in a superposition of all eight possible states from |000⟩ to |001⟩ and so on to |111⟩. Upon measurement, one of the eight states is obtained, which corresponds to one of the eight word options.
All circuits are simulated with the QASM simulator from IBM’s open source SDK, Qiskit. However if you would rather user IBM's quantum devices then you can do so, as discussed earlier.
This generator works similarly to the D&D μStarter Kit. For a more detailed layperson explanation, check out the article "How I Use Quantum Computing to Play Dungeons & Dragons".
- Radha Pyari Sandhir (Github: quantum-kittens, Twitter: RadhaPyari)
- Soham Pal (Github: e-eight, Twitter: dragonbornmonk)
- Josh Sippie (Twitter: sippenator101
- Gotham Writers Workshop (Website: writingclasses.com)
Cover photo by Amador Loureiro on Unsplash.