Exemple #1
0
import utils_plot

circuits = [
    'SNI_H*',
]

kind_d = {
    2: '.-',
    3: '.-',
    4: '.-',
    5: '.-',
    6: '.-',
    7: '.-',
    8: '.-',
    16: '-',
    32: '-',
}

for i, circuit in enumerate(circuits):
    for d, kind in kind_d.items():
        utils_plot.plot_line(circuit,
                             d,
                             utils_plot.colors[i],
                             kind,
                             label=utils_plot.LABEL_NAME,
                             obs_mis=np.logspace(-1.32, -1.22, 100))

utils_plot.setup_plot()
utils_plot.display()
Exemple #2
0
# limitations under the License.

"""
"""

import numpy as np
from matplotlib import pyplot as plt

import runtime_costs
import utils_plot

ds = list(range(1, 32))
x = [d+1 for d in ds]
muls = [
        ('GreedyMult', 'C0.-'),
        ('GreedyMult_H*', 'C1.-'),
        ('PINI', 'C2.-'),
        ]
costs = np.array(
        [[runtime_costs.cost_mul(d, mul) for d in ds] for mul, _ in muls]
        )
base_costs = np.array([runtime_costs.cost_mul(d, 'GreedyMult') for d in ds])
y = costs / base_costs
for i, (_, markinfo) in enumerate(muls):
    plt.plot(x, y[i,:], markinfo, markersize=2)
plt.legend([utils_plot.map_circ_name(mul) for mul, _ in muls])
plt.xlabel('Order $d$')
plt.ylabel('Relative runtime cost')
utils_plot.display('../presentation/figs/{}.tex')