Quantum Computing Asked on March 19, 2021
I’m trying to follow the instructions here https://qiskit.org/documentation/getting_started.html. It says
The default backend for qiskit.visualization.circuit_drawer() or
QuantumCircuit.draw() is the text backend. However, depending on your
local environment you may want to change these defaults to something
better suited for your use case. This is done with the user config
file. By default the user config file should be located in
~/.qiskit/settings.conf and is a .ini file.
I don’t see this config file anywhere. Can anyone tell me how I can find the location of this file in order to make the change from the text based plotter to the nicer plotter?
If you are working in Windows, the default location should be C:Users[user].qiskit
, which might be hidden by default. Create a text file in that folder named settings.conf
and set it up how you like.
For example by default
from qiskit import *
qc = QuantumCircuit(2)
qc.h(0)
qc.x(1)
qc.draw()
produces
With settings.conf
in the folder referenced above, containing the two lines
[default]
circuit_drawer=mpl
the same code produces
Correct answer by Jonathan Trousdale on March 19, 2021
Use the command ls -alt
in Terminal on macOS to find hidden files. It's there. This should work for all Mac users.
Answered by lizzo on March 19, 2021
I am still unable to see the ~/.qiskit/settings.conf file. Did the listing to show hidden files as well as created a new conda environment for a new qiskit environment.
I am on a mac and following the instructions listed here: https://qiskit.org/textbook/ch-prerequisites/setting-the-environment.html
Answered by acingmath on March 19, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP