repo stringclasses 798
values | file stringclasses 672
values | content stringlengths 4 6.59k |
|---|---|---|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | from qiskit import Aer, IBMQ, execute
from qiskit import transpile, assemble
from qiskit.tools.monitor import job_monitor
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
from qiskit.visualization import plot_histogram, plot_state_city
"""
Qiskit backends to execute the quantum circ... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | from qiskit import Aer, IBMQ, execute
from qiskit import transpile, assemble
from qiskit.tools.monitor import job_monitor
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
from qiskit.visualization import plot_histogram, plot_state_city
"""
Qiskit backends to execute the quantum circ... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | from qiskit import Aer, IBMQ, execute
from qiskit import transpile, assemble
from qiskit.tools.monitor import job_monitor
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
from qiskit.visualization import plot_histogram, plot_state_city
"""
Qiskit backends to execute the quantum circ... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | from qiskit import Aer, IBMQ, execute
from qiskit import transpile, assemble
from qiskit.tools.monitor import job_monitor
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
from qiskit.visualization import plot_histogram, plot_state_city
"""
Qiskit backends to execute the quantum circ... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | from qiskit import Aer, IBMQ, execute
from qiskit import transpile, assemble
from qiskit.tools.monitor import job_monitor
from qiskit.tools.monitor import job_monitor
import matplotlib.pyplot as plt
from qiskit.visualization import plot_histogram, plot_state_city
"""
Qiskit backends to execute the quantum circ... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | magic_arguments.parse_argstring(self.qiskit_job_status, line)
if args.interval is None:
args.interval = 2
_interval_set = False
else:
_interval_set = True
# Split cell lines to get LHS variables
cell_lines = cell.split('\n')
line_v... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | parse_argstring(self.qiskit_progress_bar, line)
if args.type == 'html':
HTMLProgressBar()
elif args.type == 'text':
TextProgressBar()
else:
raise qiskit.QiskitError('Invalid progress bar type.')
self.shell.ex(cell)
|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | magic_arguments.parse_argstring(self.qiskit_job_status, line)
if args.interval is None:
args.interval = 2
_interval_set = False
else:
_interval_set = True
# Split cell lines to get LHS variables
cell_lines = cell.split('\n')
line_v... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | parse_argstring(self.qiskit_progress_bar, line)
if args.type == 'html':
HTMLProgressBar()
elif args.type == 'text':
TextProgressBar()
else:
raise qiskit.QiskitError('Invalid progress bar type.')
self.shell.ex(cell)
|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | magic_arguments.parse_argstring(self.qiskit_job_status, line)
if args.interval is None:
args.interval = 2
_interval_set = False
else:
_interval_set = True
# Split cell lines to get LHS variables
cell_lines = cell.split('\n')
line_v... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | parse_argstring(self.qiskit_progress_bar, line)
if args.type == 'html':
HTMLProgressBar()
elif args.type == 'text':
TextProgressBar()
else:
raise qiskit.QiskitError('Invalid progress bar type.')
self.shell.ex(cell)
|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | magic_arguments.parse_argstring(self.qiskit_job_status, line)
if args.interval is None:
args.interval = 2
_interval_set = False
else:
_interval_set = True
# Split cell lines to get LHS variables
cell_lines = cell.split('\n')
line_v... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | parse_argstring(self.qiskit_progress_bar, line)
if args.type == 'html':
HTMLProgressBar()
elif args.type == 'text':
TextProgressBar()
else:
raise qiskit.QiskitError('Invalid progress bar type.')
self.shell.ex(cell)
|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | magic_arguments.parse_argstring(self.qiskit_job_status, line)
if args.interval is None:
args.interval = 2
_interval_set = False
else:
_interval_set = True
# Split cell lines to get LHS variables
cell_lines = cell.split('\n')
line_v... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | parse_argstring(self.qiskit_progress_bar, line)
if args.type == 'html':
HTMLProgressBar()
elif args.type == 'text':
TextProgressBar()
else:
raise qiskit.QiskitError('Invalid progress bar type.')
self.shell.ex(cell)
|
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | set to 80 characters. If you
don't want pagination at all, set `line_length=-1`.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
circui... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | g': 'T^\\dagger',
'rx': 'R_x',
'ry': 'R_y',
'rz': 'R_z',
'reset': '\\left|0\\right\\rangle'
}
You must specify all the necessary values if using this. There is
no provision for passing an incomplete dict in. (`mpl`... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | Plot style sheet option
# -----------------------------------------------------------------------------
def qx_color_scheme():
"""Return default style for matplotlib_circuit_drawer (IBM QX style)."""
return {
"comment": "Style file for matplotlib_circuit_drawer (IBM QX Composer style)",
"... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | drawing to this length. This
useful when the drawing does not fit in the console. If
None (default), it will try to guess the console width using
shutil.get_terminal_size(). If you don't want pagination
at all, set line_length=-1.
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .CalledProcessError as ex:
with open('latex_error.log', 'wb') as error_file:
error_file.write(ex.stdout)
logger.warning('WARNING Unable to compile latex. '
'The output from the pdflatex command can '
'be found in latex_er... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | to `left`. Says how
the circuit should be justified.
Returns:
matplotlib.figure: a matplotlib figure object for the circuit diagram
"""
qregs, cregs, ops = utils._get_layered_instructions(circuit,
reverse_bits=reverse_b... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | set to 80 characters. If you
don't want pagination at all, set `line_length=-1`.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
circui... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | g': 'T^\\dagger',
'rx': 'R_x',
'ry': 'R_y',
'rz': 'R_z',
'reset': '\\left|0\\right\\rangle'
}
You must specify all the necessary values if using this. There is
no provision for passing an incomplete dict in. (`mpl`... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | Plot style sheet option
# -----------------------------------------------------------------------------
def qx_color_scheme():
"""Return default style for matplotlib_circuit_drawer (IBM QX style)."""
return {
"comment": "Style file for matplotlib_circuit_drawer (IBM QX Composer style)",
"... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | drawing to this length. This
useful when the drawing does not fit in the console. If
None (default), it will try to guess the console width using
shutil.get_terminal_size(). If you don't want pagination
at all, set line_length=-1.
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .CalledProcessError as ex:
with open('latex_error.log', 'wb') as error_file:
error_file.write(ex.stdout)
logger.warning('WARNING Unable to compile latex. '
'The output from the pdflatex command can '
'be found in latex_er... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | to `left`. Says how
the circuit should be justified.
Returns:
matplotlib.figure: a matplotlib figure object for the circuit diagram
"""
qregs, cregs, ops = utils._get_layered_instructions(circuit,
reverse_bits=reverse_b... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | set to 80 characters. If you
don't want pagination at all, set `line_length=-1`.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
circui... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | g': 'T^\\dagger',
'rx': 'R_x',
'ry': 'R_y',
'rz': 'R_z',
'reset': '\\left|0\\right\\rangle'
}
You must specify all the necessary values if using this. There is
no provision for passing an incomplete dict in. (`mpl`... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | Plot style sheet option
# -----------------------------------------------------------------------------
def qx_color_scheme():
"""Return default style for matplotlib_circuit_drawer (IBM QX style)."""
return {
"comment": "Style file for matplotlib_circuit_drawer (IBM QX Composer style)",
"... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | drawing to this length. This
useful when the drawing does not fit in the console. If
None (default), it will try to guess the console width using
shutil.get_terminal_size(). If you don't want pagination
at all, set line_length=-1.
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .CalledProcessError as ex:
with open('latex_error.log', 'wb') as error_file:
error_file.write(ex.stdout)
logger.warning('WARNING Unable to compile latex. '
'The output from the pdflatex command can '
'be found in latex_er... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | to `left`. Says how
the circuit should be justified.
Returns:
matplotlib.figure: a matplotlib figure object for the circuit diagram
"""
qregs, cregs, ops = utils._get_layered_instructions(circuit,
reverse_bits=reverse_b... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | set to 80 characters. If you
don't want pagination at all, set `line_length=-1`.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
circui... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | g': 'T^\\dagger',
'rx': 'R_x',
'ry': 'R_y',
'rz': 'R_z',
'reset': '\\left|0\\right\\rangle'
}
You must specify all the necessary values if using this. There is
no provision for passing an incomplete dict in. (`mpl`... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | Plot style sheet option
# -----------------------------------------------------------------------------
def qx_color_scheme():
"""Return default style for matplotlib_circuit_drawer (IBM QX style)."""
return {
"comment": "Style file for matplotlib_circuit_drawer (IBM QX Composer style)",
"... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | drawing to this length. This
useful when the drawing does not fit in the console. If
None (default), it will try to guess the console width using
shutil.get_terminal_size(). If you don't want pagination
at all, set line_length=-1.
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .CalledProcessError as ex:
with open('latex_error.log', 'wb') as error_file:
error_file.write(ex.stdout)
logger.warning('WARNING Unable to compile latex. '
'The output from the pdflatex command can '
'be found in latex_er... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | to `left`. Says how
the circuit should be justified.
Returns:
matplotlib.figure: a matplotlib figure object for the circuit diagram
"""
qregs, cregs, ops = utils._get_layered_instructions(circuit,
reverse_bits=reverse_b... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | set to 80 characters. If you
don't want pagination at all, set `line_length=-1`.
reverse_bits (bool): When set to True reverse the bit order inside
registers for the output visualization.
plot_barriers (bool): Enable/disable drawing barriers in the output
circui... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | g': 'T^\\dagger',
'rx': 'R_x',
'ry': 'R_y',
'rz': 'R_z',
'reset': '\\left|0\\right\\rangle'
}
You must specify all the necessary values if using this. There is
no provision for passing an incomplete dict in. (`mpl`... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | Plot style sheet option
# -----------------------------------------------------------------------------
def qx_color_scheme():
"""Return default style for matplotlib_circuit_drawer (IBM QX style)."""
return {
"comment": "Style file for matplotlib_circuit_drawer (IBM QX Composer style)",
"... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | drawing to this length. This
useful when the drawing does not fit in the console. If
None (default), it will try to guess the console width using
shutil.get_terminal_size(). If you don't want pagination
at all, set line_length=-1.
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .CalledProcessError as ex:
with open('latex_error.log', 'wb') as error_file:
error_file.write(ex.stdout)
logger.warning('WARNING Unable to compile latex. '
'The output from the pdflatex command can '
'be found in latex_er... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | to `left`. Says how
the circuit should be justified.
Returns:
matplotlib.figure: a matplotlib figure object for the circuit diagram
"""
qregs, cregs, ops = utils._get_layered_instructions(circuit,
reverse_bits=reverse_b... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
if p in self.__gate_placed:
return False
return True
def set_index(self, index, gate_width):
h_pos = index % self.__fold + 1
if h_pos + (gate_width - 1) > self.__fold:
_index = index + self.__fold - (h_pos - 1)
else:
_in... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | x in xy])
ypos = min([y[1] for y in xy])
ypos_max = max([y[1] for y in xy])
if wide:
if subtext:
boxes_length = round(max([len(text), len(subtext)]) / 8) or 1
else:
boxes_length = round(len(text) / 8) or 1
wid = WID * 2... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .add_patch(box)
if text:
if text in self._style.dispcol:
disp_text = "${}$".format(self._style.disptex[text])
else:
disp_text = text
if subtext:
self.ax.text(xpos, ypos + 0.15 * HIG, disp_text, ha='center',
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .0,
linestyle=linestyle,
zorder=PORDER_LINE)
def _measure(self, qxy, cxy, cid):
qx, qy = qxy
cx, cy = cxy
self._gate(qxy, fc=self._style.dispcol['meas'])
# add measure symbol
arc = patches.Arc(xy=(qx, qy - 0.15 * H... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | , ypos + 0.35 * HIG],
color=self._style.lc, linewidth=1.0, zorder=PORDER_GATE)
self.ax.plot([xpos - 0.35 * HIG, xpos + 0.35 * HIG], [ypos, ypos],
color=self._style.lc, linewidth=1.0, zorder=PORDER_GATE)
def _swap(self, xy):
xpos, ypos = xy
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | - self._style.margin[0]
_xr = self._cond['xmax'] + self._style.margin[1]
_yb = - self._cond['ymax'] - self._style.margin[2] + 1 - 0.5
_yt = self._style.margin[3] + 0.5
self.ax.set_xlim(_xl, _xr)
self.ax.set_ylim(_yb, _yt)
# update figure size
fig_w = _xr -... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | va='center',
fontsize=self._style.fs,
color=self._style.tc,
clip_on=True,
zorder=PORDER_TEXT)
self._line([0, y], [self._cond['xmax'], y])
# classical register
this_creg_dict = {}
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | < 2:
layer_width = 2
# if custom gate with a longer than standard name determine
# width
elif op.name not in ['barrier','snapshot', 'load','save',
'noise', 'cswap','swap','measure'] and len(
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | the value from plotting
this_anc = q_anchors[q_idxs[0]].gate_anchor
if verbose:
print(op)
if op.type == 'op' and hasattr(op.op, 'params'):
param = self.param_parse(op.op.params, self._style.pimode)
else:
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | ubit gates
#
elif len(q_xy) == 1:
disp = op.name
if param:
prm = '({})'.format(param)
if len(prm) < 20:
self._gate(q_xy[0], wide=_iswide, text=disp,
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | 3:
# cswap gate
if op.name == 'cswap':
self._ctrl_qubit(q_xy[0])
self._swap(q_xy[1])
self._swap(q_xy[2])
# add qubit-qubit wiring
self._line(qreg_b, qre... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
try:
param_parts[i] = MatplotlibDrawer.format_pi(e)
except TypeError:
param_parts[i] = str(e)
else:
try:
param_parts[i] = MatplotlibDrawer.format_numeric(e)
except TypeError:
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | pulses[start_time].append(pulse.command)
else:
self.pulses[start_time] = [pulse.command]
@property
def waveform(self):
"""Get waveform."""
if self._waveform is None:
self._build_waveform()
return self._waveform[self.t0:self.tf]
@property... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
duration = command.duration
tf = min(time + duration, self.tf)
if isinstance(command, SamplePulse):
wf[time:tf] = np.exp(1j*fc) * command.samples[:tf-time]
pv[time:] = 0
self._labels[time] = (tf, command)
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | v_max, 1.2 * v_max)
return figure
class ScheduleDrawer:
"""A class to create figure for schedule and channel."""
def __init__(self, style):
"""Create new figure.
Args:
style (OPStyleSched): style sheet
"""
self.style = style or OPStyleSched... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | form += 1
events.enable = True
if scaling:
v_max = 0.5 * scaling
else:
v_max = 0.5 / (1.2 * v_max)
return n_valid_waveform, v_max
def _draw_table(self, figure, channels, dt, n_valid_waveform):
del n_valid_waveform # unused
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | ='center')
def _draw_framechanges(self, ax, fcs, dt, y0):
framechanges_present = True
for time in fcs.keys():
ax.text(x=time*dt, y=y0, s=r'$\circlearrowleft$',
fontsize=self.style.icon_font_size,
ha='center', va='center')
return fr... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | x=time, y1=re, y2=offset,
facecolor=color[0], alpha=0.3,
edgecolor=color[0], linewidth=1.5,
label='real part')
ax.fill_between(x=time, y1=im, y2=offset,
facecolor=color[1]... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | y0 = self._draw_channels(ax, output_channels, interp_method,
t0, tf, dt, v_max, label=label,
framechange=framechange)
self._draw_snapshots(ax, snapshot_channels, dt, y0)
ax.set_xlim(t0 * dt, tf * dt)
ax.set_ylim(y0, 1)
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
if p in self.__gate_placed:
return False
return True
def set_index(self, index, gate_width):
h_pos = index % self.__fold + 1
if h_pos + (gate_width - 1) > self.__fold:
_index = index + self.__fold - (h_pos - 1)
else:
_in... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | x in xy])
ypos = min([y[1] for y in xy])
ypos_max = max([y[1] for y in xy])
if wide:
if subtext:
boxes_length = round(max([len(text), len(subtext)]) / 8) or 1
else:
boxes_length = round(len(text) / 8) or 1
wid = WID * 2... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .add_patch(box)
if text:
if text in self._style.dispcol:
disp_text = "${}$".format(self._style.disptex[text])
else:
disp_text = text
if subtext:
self.ax.text(xpos, ypos + 0.15 * HIG, disp_text, ha='center',
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | .0,
linestyle=linestyle,
zorder=PORDER_LINE)
def _measure(self, qxy, cxy, cid):
qx, qy = qxy
cx, cy = cxy
self._gate(qxy, fc=self._style.dispcol['meas'])
# add measure symbol
arc = patches.Arc(xy=(qx, qy - 0.15 * H... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | , ypos + 0.35 * HIG],
color=self._style.lc, linewidth=1.0, zorder=PORDER_GATE)
self.ax.plot([xpos - 0.35 * HIG, xpos + 0.35 * HIG], [ypos, ypos],
color=self._style.lc, linewidth=1.0, zorder=PORDER_GATE)
def _swap(self, xy):
xpos, ypos = xy
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | - self._style.margin[0]
_xr = self._cond['xmax'] + self._style.margin[1]
_yb = - self._cond['ymax'] - self._style.margin[2] + 1 - 0.5
_yt = self._style.margin[3] + 0.5
self.ax.set_xlim(_xl, _xr)
self.ax.set_ylim(_yb, _yt)
# update figure size
fig_w = _xr -... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | va='center',
fontsize=self._style.fs,
color=self._style.tc,
clip_on=True,
zorder=PORDER_TEXT)
self._line([0, y], [self._cond['xmax'], y])
# classical register
this_creg_dict = {}
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | < 2:
layer_width = 2
# if custom gate with a longer than standard name determine
# width
elif op.name not in ['barrier','snapshot', 'load','save',
'noise', 'cswap','swap','measure'] and len(
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | the value from plotting
this_anc = q_anchors[q_idxs[0]].gate_anchor
if verbose:
print(op)
if op.type == 'op' and hasattr(op.op, 'params'):
param = self.param_parse(op.op.params, self._style.pimode)
else:
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | ubit gates
#
elif len(q_xy) == 1:
disp = op.name
if param:
prm = '({})'.format(param)
if len(prm) < 20:
self._gate(q_xy[0], wide=_iswide, text=disp,
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | 3:
# cswap gate
if op.name == 'cswap':
self._ctrl_qubit(q_xy[0])
self._swap(q_xy[1])
self._swap(q_xy[2])
# add qubit-qubit wiring
self._line(qreg_b, qre... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
try:
param_parts[i] = MatplotlibDrawer.format_pi(e)
except TypeError:
param_parts[i] = str(e)
else:
try:
param_parts[i] = MatplotlibDrawer.format_numeric(e)
except TypeError:
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | pulses[start_time].append(pulse.command)
else:
self.pulses[start_time] = [pulse.command]
@property
def waveform(self):
"""Get waveform."""
if self._waveform is None:
self._build_waveform()
return self._waveform[self.t0:self.tf]
@property... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc |
duration = command.duration
tf = min(time + duration, self.tf)
if isinstance(command, SamplePulse):
wf[time:tf] = np.exp(1j*fc) * command.samples[:tf-time]
pv[time:] = 0
self._labels[time] = (tf, command)
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | v_max, 1.2 * v_max)
return figure
class ScheduleDrawer:
"""A class to create figure for schedule and channel."""
def __init__(self, style):
"""Create new figure.
Args:
style (OPStyleSched): style sheet
"""
self.style = style or OPStyleSched... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | form += 1
events.enable = True
if scaling:
v_max = 0.5 * scaling
else:
v_max = 0.5 / (1.2 * v_max)
return n_valid_waveform, v_max
def _draw_table(self, figure, channels, dt, n_valid_waveform):
del n_valid_waveform # unused
... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | ='center')
def _draw_framechanges(self, ax, fcs, dt, y0):
framechanges_present = True
for time in fcs.keys():
ax.text(x=time*dt, y=y0, s=r'$\circlearrowleft$',
fontsize=self.style.icon_font_size,
ha='center', va='center')
return fr... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | x=time, y1=re, y2=offset,
facecolor=color[0], alpha=0.3,
edgecolor=color[0], linewidth=1.5,
label='real part')
ax.fill_between(x=time, y1=im, y2=offset,
facecolor=color[1]... |
https://github.com/indian-institute-of-science-qc/qiskit-aakash | indian-institute-of-science-qc | y0 = self._draw_channels(ax, output_channels, interp_method,
t0, tf, dt, v_max, label=label,
framechange=framechange)
self._draw_snapshots(ax, snapshot_channels, dt, y0)
ax.set_xlim(t0 * dt, tf * dt)
ax.set_ylim(y0, 1)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.