-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
What is the expected enhancement?
In #5063, the IQX color scheme was added as an option to the mpl drawer. The style dict entry, 'displaycolor' was expanded to include new gates and to allow for entering both gate and text color for each gate type. This expands color choices to include dark gate colors with light text. This first phase was done by creating 3 classes in qcstyle.py.
In this next phase, this can be reduced to 1 default class and the additional styles would be read in from json files. I don't believe users should be allowed to edit these 3 json files - default, iqx, and bw - directly, but they can copy these and create new styles of their own.
This issue proposes to make default, iqx, and bw json style files part of qiskit, perhaps in a styles directory under the visualization directory. User json files should go in a fixed place, perhaps in a styles directory under ~/.qiskit.
The code for reading in the json files already exists, though there is only minimal error checking currently. Deciding on the locations for the files is the main issue.
We might want to look at any possible special cases, like the controlled classical gates in iqx and see if any of these can be addressed in a generic way. Right now all a user can do with color is change the colors of the specific gate names in 'displaycolor'.
Any of the other documented style dict items can be set in the user json file. The user can create a partial style dict in the file, and only those elements entered will be changed for that style.
The user interface is simple - qc.draw('mpl', style='user_style1.json')