qiskit_aqua package¶
Subpackages¶
- qiskit_aqua.classicalsvm package
- qiskit_aqua.dynamics package
- qiskit_aqua.exacteigensolver package
- qiskit_aqua.grover package
- qiskit_aqua.input package
- qiskit_aqua.iqpe package
- qiskit_aqua.ising package
- qiskit_aqua.multiclass package
- qiskit_aqua.multiclass_classicalsvm package
- qiskit_aqua.multiclass_quantumsvm package
- qiskit_aqua.parser package
- qiskit_aqua.qaoa package
- qiskit_aqua.qpe package
- qiskit_aqua.svm package
- qiskit_aqua.ui package
- qiskit_aqua.utils package
- Subpackages
- qiskit_aqua.utils.feature_extractions package
- qiskit_aqua.utils.initial_states package
- qiskit_aqua.utils.iqfts package
- qiskit_aqua.utils.optimizers package
- Subpackages
- Submodules
- qiskit_aqua.utils.optimizers.cg module
- qiskit_aqua.utils.optimizers.cobyla module
- qiskit_aqua.utils.optimizers.l_bfgs_b module
- qiskit_aqua.utils.optimizers.nelder_mead module
- qiskit_aqua.utils.optimizers.optimizer module
- qiskit_aqua.utils.optimizers.p_bfgs module
- qiskit_aqua.utils.optimizers.powell module
- qiskit_aqua.utils.optimizers.slsqp module
- qiskit_aqua.utils.optimizers.spsa module
- qiskit_aqua.utils.optimizers.tnc module
- Module contents
- qiskit_aqua.utils.oracles package
- qiskit_aqua.utils.variational_forms package
- Submodules
- qiskit_aqua.utils.decimal_to_binary module
- qiskit_aqua.utils.entangler_map module
- qiskit_aqua.utils.jsonutils module
- qiskit_aqua.utils.pauligraph module
- qiskit_aqua.utils.random_matrix_generator module
- qiskit_aqua.utils.subsystem module
- qiskit_aqua.utils.summarize_circuits module
- qiskit_aqua.utils.tensorproduct module
- Module contents
- Subpackages
- qiskit_aqua.vqe package
Submodules¶
qiskit_aqua.algomethods module¶
Algorithm functions for running etc.
-
qiskit_aqua.algomethods.
run_algorithm
(params, algo_input=None, json_output=False)[source]¶ Run algorithm as named in params, using params and algo_input as input data and returning a result dictionary
Parameters: - params (dict) – Dictionary of params for algo and dependent objects
- algo_input (algorithminput) – Main input data for algorithm. Optional, an algo may run entirely from params
- json_output (bool) – False for regular python dictionary return, True for json conversion
Returns: Result dictionary containing result of algorithm computation
-
qiskit_aqua.algomethods.
run_algorithm_to_json
(params, algo_input=None, jsonfile='algorithm.json')[source]¶ Run algorithm as named in params, using params and algo_input as input data and save the combined input as a json file. This json is self-contained and can later be used as a basis to call run_algorithm
Parameters: - params (dict) – Dictionary of params for algo and dependent objects
- algo_input (algorithminput) – Main input data for algorithm. Optional, an algo may run entirely from params
- jsonfile (string) – Name of file in which json should be saved
Returns: Result dictionary containing the jsonfile name
qiskit_aqua.algorithmerror module¶
Exception for errors raised by the Algorithm SDK.
qiskit_aqua.operator module¶
-
class
qiskit_aqua.operator.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Bases:
object
-
MAX_CIRCUITS_PER_JOB
= 300¶ Operators relevant for quantum applications
Note
For grouped paulis represnetation, all operations will always convert it to paulis and then convert it back. (It might be a performance issue.)
-
__init__
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Parameters: - paulis ([[float, Pauli]]) – each list contains a coefficient (real number) and a corresponding Pauli class object.
- grouped_paulis ([[[float, Pauli]]]) – each list of list contains a grouped paulis.
- matrix (numpy.ndarray or scipy.sparse.csr_matrix) – a 2-D sparse matrix represents operator (using CSR format internally)
- coloring (bool) – method to group paulis.
-
chop
(threshold=1e-15)[source]¶ Eliminate the real and imagine part of coeff in each pauli by threshold. If pauli’s coeff is less then threshold in both real and imagine parts, the pauli is removed. To align the internal representations, all available representations are chopped. The chopped result is stored back to original property. Note: if coeff is real-only, the imag part is skipped.
Parameters: threshold (float) – threshold chops the paulis
-
coloring
¶ Getter of method of grouping paulis
-
construct_evolution_circuit
(slice_pauli_list, evo_time, num_time_slices, state_registers, ancillary_registers=None, ctl_idx=0, unitary_power=None, use_basis_gates=True)[source]¶ Construct the evolution circuit according to the supplied specification.
Parameters: - slice_pauli_list (list) – The list of pauli terms corresponding to a single time slice to be evolved
- evo_time (int) – The evolution time
- num_time_slices (int) – The number of time slices for the expansion
- state_registers (QuantumRegister) – The Qiskit QuantumRegister corresponding to the qubits of the system
- ancillary_registers (QuantumRegister) – The optional Qiskit QuantumRegister corresponding to the control qubits for the state_registers of the system
- ctl_idx (int) – The index of the qubit of the control ancillary_registers to use
- unitary_power (int) – The power to which the unitary operator is to be raised
- use_basis_gates (bool) – boolean flag for indicating only using basis gates when building circuit.
Returns: The Qiskit QuantumCircuit corresponding to specified evolution.
Return type: QuantumCircuit
-
convert
(input_format, output_format, force=False)[source]¶ A wrapper for conversion among all representations. Note that, if the output target is already there, it will skip the conversion. The result is stored back into its property directly.
Parameters: - input_format (str) – case-insensitive input format, should be one of “paulis”, “grouped_paulis”, “matrix”
- output_format (str) – case-insensitive output format, should be one of “paulis”, “grouped_paulis”, “matrix”
- force (bool) – convert to targeted format regardless its present.
Raises: ValueError
– if the unsupported output_format is specified.
-
eval
(operator_mode, input_circuit, backend, execute_config={}, qjob_config={})[source]¶ Supporting three ways to evaluate the given circuits with the operator. 1. If input_circuit is a numpy.ndarray, it will directly perform inner product with the operator. 2. If backend is a statevector simulator, use quantum backend to get statevector
and then evaluate with the operator.- Other cases: it use with quanutm backend (simulator or real quantum machine), to obtain the mean and standard deviation of measured results.
Parameters: - operator_mode (str) – representation of operator, including paulis, grouped_paulis and matrix
- input_circuit (QuantumCircuit or numpy.ndarray) – the quantum circuit.
- backend (str) – backend selection for quantum machine.
- execute_config (dict) – execution setting to quautum backend, refer to qiskit.wrapper.execute for details.
- qjob_config (dict) – the setting to retrieve results from quantum backend, including timeout and wait.
Returns: mean and standard deviation of avg
Return type: float, float
-
evolve
(state_in, evo_time, evo_mode, num_time_slices, quantum_registers=None, paulis_grouping='random', expansion_mode='trotter', expansion_order=1)[source]¶ Carry out the dynamics evolution for the operator under supplied specifications.
Parameters: - state_in – The initial state for the evolution
- evo_time (int) – The evolution time
- evo_mode (str) – The mode under which the evolution is carried out. Currently only support ‘matrix’ or ‘circuit’
- num_time_slices (int) – The number of time slices for the expansion
- quantum_registers (QuantumRegister) – The QuantumRegister to build the QuantumCircuit off of
- paulis_grouping (str) – The grouping to dictate the ordering of the pauli terms. See reorder_paulis method for more details.
- expansion_mode (str) – The mode under which the expansion is to be done. Currently support ‘trotter’, which follows the expansion as discussed in http://science.sciencemag.org/content/273/5278/1073, and ‘suzuki’, which corresponds to the discussion in https://arxiv.org/pdf/quant-ph/0508139.pdf
- expansion_order (int) – The order for suzuki expansion
Returns: Depending on the evo_mode specified, either return the matrix vector multiplication result or the constructed QuantumCircuit.
-
find_Z2_symmetries
()[source]¶ Finds Z2 Pauli-type symmetries of an Operator
Returns: the list of Pauli objects representing the Z2 symmetries [Pauli]: the list of single - qubit Pauli objects to construct the Cliffors operators [Operators]: the list of Clifford unitaries to block diagonalize Operator [int]: the list of support of the single-qubit Pauli objects used to build the clifford operators Return type: [Pauli]
-
grouped_paulis
¶ Getter of grouped Pauli list.
-
static
kernel_F2
(matrix_in)[source]¶ Computes the kernel of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: the list of kernel vectors Return type: [np.ndarray]
-
static
load_from_dict
(dictionary)[source]¶ Load paulis in a dict to construct an Operator, the dict must be represented as follows: label and coeff (real and imag). E.g.:
- {‘paulis’:
- [
- {‘label’: ‘IIII’,
- ‘coeff’: {‘real’: -0.33562957575267038, ‘imag’: 0.0}},
- {‘label’: ‘ZIII’,
- ‘coeff’: {‘real’: 0.28220597164664896, ‘imag’: 0.0}}, …
]
}
Parameters: dictionary (dict) – dictionary, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator
-
static
load_from_file
(file_name)[source]¶ Load paulis in a file to construct an Operator, only support paulis as an input and its coefficient is real. E.g.:
IIII 0.34511 ZZZZ 0.31256 XXYY 5.84215 …Parameters: file_name (str) – path to the file, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator class
-
matrix
¶ Getter of matrix; if matrix is diagonal, diagonal matrix is returned instead.
-
num_qubits
¶ number of qubits required for the operator.
Returns: number of qubits Return type: int
-
paulis
¶ Getter of Pauli list.
-
print_operators
(print_format='paulis')[source]¶ Print out the paulis in the selected representation.
Parameters: print_format (str) – “paulis”, “grouped_paulis”, “matrix” Returns: a formated operator. Return type: str Raises: ValueError
– if print_format is not supported.
-
static
qubit_tapering
(operator, cliffords, sq_list, tapering_values)[source]¶ Builds an Operator which has a number of qubits tapered off, based on a block-diagonal Operator built using a list of cliffords. The block-diagonal subspace is an input parameter, set through the list tapering_values, which takes values +/- 1.
Parameters: - operator (Operator) – the target operator to be tapered
- cliffords ([Operator]) – list of unitary Clifford transformation
- sq_list ([int]) – position of the single-qubit operators that anticommute
- the cliffords (with) –
- tapering_values ([int]) – array of +/- 1 used to select the subspace. Length
- to be equal to the length of cliffords and sq_list (has) –
Returns: the tapered operator
Return type:
-
reorder_paulis
(grouping=None)[source]¶ Reorder the pauli terms according to the specified grouping.
Parameters: grouping (str) – The name of the grouping, currently supports ‘random’ and ‘default’. ‘random’ corresponds to the order of Operator.paulis; ‘default’ corresponds to the grouping as specified by Operator.grouped_paulis Returns: The list of pauli terms as ordered per the specified grouping Return type: list
-
representations
¶ Return the available represnetations in the Operator.
Returns: available representations ([str]) Return type: list
-
static
row_echelon_F2
(matrix_in)[source]¶ Computes the row Echelon form of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: matrix_in in Echelon row form Return type: np.ndarray
-
save_to_dict
()[source]¶ Save operator to a dict in pauli represnetation.
Returns: a dictionary contains an operator with pauli representation. Return type: dict
-
save_to_file
(file_name)[source]¶ Save operator to a file in pauli representation.
Parameters: file_name (str) – path to the file
-
two_qubit_reduced_operator
(m, threshold=1e-13)[source]¶ Eliminates the central and last qubit in a list of Pauli that has diagonal operators (Z,I) at those positions
Chemistry specific method: It can be used to taper two qubits in parity and binary-tree mapped fermionic Hamiltonians when the spin orbitals are ordered in two spin sectors, (block spin order) according to the number of particles in the system.
Parameters: - m (int) – number of fermionic particles
- threshold (float) – threshold for Pauli simplification
Returns: a new operator whose qubit number is reduced by 2.
Return type:
-
qiskit_aqua.preferences module¶
qiskit_aqua.quantumalgorithm module¶
This module implements the abstract base class for algorithm modules.
To create add-on algorithm modules subclass the QuantumAlgorithm class in this module. Doing so requires that the required algorithm interface is implemented.
-
class
qiskit_aqua.quantumalgorithm.
QuantumAlgorithm
(configuration=None)[source]¶ Bases:
abc.ABC
-
EQUIVALENT_BACKENDS
= {'local_qasm_simulator_cpp': 'local_qasm_simulator', 'local_qasm_simulator_projectq': 'local_qasm_simulator', 'local_qasm_simulator_py': 'local_qasm_simulator', 'local_statevector_simulator_cpp': 'local_statevector_simulator', 'local_statevector_simulator_projectq': 'local_statevector_simulator', 'local_statevector_simulator_py': 'local_statevector_simulator', 'local_statevector_simulator_sympy': 'local_statevector_simulator'}¶ Base class for Algorithms.
This method should initialize the module and its configuration, and use an exception if a component of the module is available.
Parameters: configuration (dict) – configuration dictionary
-
MAX_CIRCUITS_PER_JOB
= 300¶
-
SECTION_KEY_ALGORITHM
= 'algorithm'¶
-
SECTION_KEY_FEATURE_EXTRACTION
= 'feature_extraction'¶
-
SECTION_KEY_INITIAL_STATE
= 'initial_state'¶
-
SECTION_KEY_IQFT
= 'iqft'¶
-
SECTION_KEY_OPTIMIZER
= 'optimizer'¶
-
SECTION_KEY_ORACLE
= 'oracle'¶
-
SECTION_KEY_VAR_FORM
= 'variational_form'¶
-
UNSUPPORTED_BACKENDS
= ['local_unitary_simulator', 'local_clifford_simulator']¶
-
configuration
¶ Return algorithm configuration
-
execute
(circuits)[source]¶ A wrapper for all algorithms to interface with quantum backend.
Parameters: circuits (QuantumCircuit or list[QuantumCircuit]) – circuits to execute Returns: Result objects it will be a list if number of circuits exceed the maximum number (300) Return type: Result or [Result]
-
qconfig
¶ Return Qconfig configuration
-
random
¶ Return a numpy random
-
random_seed
¶ Return random seed
-
setup_quantum_backend
(backend='local_statevector_simulator', shots=1024, skip_transpiler=False, noise_params=None, coupling_map=None, initial_layout=None, hpc_params=None, basis_gates=None, max_credits=10, timeout=None, wait=5)[source]¶ Setup the quantum backend.
Parameters: - backend (str) – name of selected backend
- shots (int) – number of shots for the backend
- skip_transpiler (bool) – skip most of the compile steps and produce qobj directly
- noise_params (dict) – the noise setting for simulator
- coupling_map (list) – coupling map (perhaps custom) to target in mapping
- initial_layout (dict) – initial layout of qubits in mapping
- hpc_params (dict) – HPC simulator parameters
- basis_gates (str) – comma-separated basis gate set to compile to
- max_credits (int) – maximum credits to use
- timeout (float or None) – seconds to wait for job. If None, wait indefinitely.
- wait (float) – seconds between queries
Raises: AlgorithmError
– set backend with invalid Qconfig
-
Module contents¶
Algorithm discovery methods, Error and Base classes
-
qiskit_aqua.
get_qconfig
()[source]¶ Returns current Qconfog module if found :returns: Qconfig module :rtype: module
-
qiskit_aqua.
set_qconfig
(qconfig)[source]¶ Sets the Qconfig.py module. :param qconfig: Qconfig module :type qconfig: object
-
qiskit_aqua.
load_qconfig
()[source]¶ Attemps to load the Qconfig.py searching the current environment. :returns: Qconfig module :rtype: module
-
qiskit_aqua.
discover_qconfig
(directory)[source]¶ Discovers the Qconfig.py and attempts to load it. :param directory: Directory to search for Qconfig.py. :type directory: str
Returns: Qconfig module Return type: module
-
exception
qiskit_aqua.
AlgorithmError
(*message)[source]¶ Bases:
Exception
Base class for errors raised by the Algorithm SDK.
-
args
¶
-
with_traceback
()¶ Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
-
-
class
qiskit_aqua.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Bases:
object
-
MAX_CIRCUITS_PER_JOB
= 300¶ Operators relevant for quantum applications
Note
For grouped paulis represnetation, all operations will always convert it to paulis and then convert it back. (It might be a performance issue.)
-
__init__
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Parameters: - paulis ([[float, Pauli]]) – each list contains a coefficient (real number) and a corresponding Pauli class object.
- grouped_paulis ([[[float, Pauli]]]) – each list of list contains a grouped paulis.
- matrix (numpy.ndarray or scipy.sparse.csr_matrix) – a 2-D sparse matrix represents operator (using CSR format internally)
- coloring (bool) – method to group paulis.
-
chop
(threshold=1e-15)[source]¶ Eliminate the real and imagine part of coeff in each pauli by threshold. If pauli’s coeff is less then threshold in both real and imagine parts, the pauli is removed. To align the internal representations, all available representations are chopped. The chopped result is stored back to original property. Note: if coeff is real-only, the imag part is skipped.
Parameters: threshold (float) – threshold chops the paulis
-
coloring
¶ Getter of method of grouping paulis
-
construct_evolution_circuit
(slice_pauli_list, evo_time, num_time_slices, state_registers, ancillary_registers=None, ctl_idx=0, unitary_power=None, use_basis_gates=True)[source]¶ Construct the evolution circuit according to the supplied specification.
Parameters: - slice_pauli_list (list) – The list of pauli terms corresponding to a single time slice to be evolved
- evo_time (int) – The evolution time
- num_time_slices (int) – The number of time slices for the expansion
- state_registers (QuantumRegister) – The Qiskit QuantumRegister corresponding to the qubits of the system
- ancillary_registers (QuantumRegister) – The optional Qiskit QuantumRegister corresponding to the control qubits for the state_registers of the system
- ctl_idx (int) – The index of the qubit of the control ancillary_registers to use
- unitary_power (int) – The power to which the unitary operator is to be raised
- use_basis_gates (bool) – boolean flag for indicating only using basis gates when building circuit.
Returns: The Qiskit QuantumCircuit corresponding to specified evolution.
Return type: QuantumCircuit
-
convert
(input_format, output_format, force=False)[source]¶ A wrapper for conversion among all representations. Note that, if the output target is already there, it will skip the conversion. The result is stored back into its property directly.
Parameters: - input_format (str) – case-insensitive input format, should be one of “paulis”, “grouped_paulis”, “matrix”
- output_format (str) – case-insensitive output format, should be one of “paulis”, “grouped_paulis”, “matrix”
- force (bool) – convert to targeted format regardless its present.
Raises: ValueError
– if the unsupported output_format is specified.
-
eval
(operator_mode, input_circuit, backend, execute_config={}, qjob_config={})[source]¶ Supporting three ways to evaluate the given circuits with the operator. 1. If input_circuit is a numpy.ndarray, it will directly perform inner product with the operator. 2. If backend is a statevector simulator, use quantum backend to get statevector
and then evaluate with the operator.- Other cases: it use with quanutm backend (simulator or real quantum machine), to obtain the mean and standard deviation of measured results.
Parameters: - operator_mode (str) – representation of operator, including paulis, grouped_paulis and matrix
- input_circuit (QuantumCircuit or numpy.ndarray) – the quantum circuit.
- backend (str) – backend selection for quantum machine.
- execute_config (dict) – execution setting to quautum backend, refer to qiskit.wrapper.execute for details.
- qjob_config (dict) – the setting to retrieve results from quantum backend, including timeout and wait.
Returns: mean and standard deviation of avg
Return type: float, float
-
evolve
(state_in, evo_time, evo_mode, num_time_slices, quantum_registers=None, paulis_grouping='random', expansion_mode='trotter', expansion_order=1)[source]¶ Carry out the dynamics evolution for the operator under supplied specifications.
Parameters: - state_in – The initial state for the evolution
- evo_time (int) – The evolution time
- evo_mode (str) – The mode under which the evolution is carried out. Currently only support ‘matrix’ or ‘circuit’
- num_time_slices (int) – The number of time slices for the expansion
- quantum_registers (QuantumRegister) – The QuantumRegister to build the QuantumCircuit off of
- paulis_grouping (str) – The grouping to dictate the ordering of the pauli terms. See reorder_paulis method for more details.
- expansion_mode (str) – The mode under which the expansion is to be done. Currently support ‘trotter’, which follows the expansion as discussed in http://science.sciencemag.org/content/273/5278/1073, and ‘suzuki’, which corresponds to the discussion in https://arxiv.org/pdf/quant-ph/0508139.pdf
- expansion_order (int) – The order for suzuki expansion
Returns: Depending on the evo_mode specified, either return the matrix vector multiplication result or the constructed QuantumCircuit.
-
find_Z2_symmetries
()[source]¶ Finds Z2 Pauli-type symmetries of an Operator
Returns: the list of Pauli objects representing the Z2 symmetries [Pauli]: the list of single - qubit Pauli objects to construct the Cliffors operators [Operators]: the list of Clifford unitaries to block diagonalize Operator [int]: the list of support of the single-qubit Pauli objects used to build the clifford operators Return type: [Pauli]
-
grouped_paulis
¶ Getter of grouped Pauli list.
-
static
kernel_F2
(matrix_in)[source]¶ Computes the kernel of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: the list of kernel vectors Return type: [np.ndarray]
-
static
load_from_dict
(dictionary)[source]¶ Load paulis in a dict to construct an Operator, the dict must be represented as follows: label and coeff (real and imag). E.g.:
- {‘paulis’:
- [
- {‘label’: ‘IIII’,
- ‘coeff’: {‘real’: -0.33562957575267038, ‘imag’: 0.0}},
- {‘label’: ‘ZIII’,
- ‘coeff’: {‘real’: 0.28220597164664896, ‘imag’: 0.0}}, …
]
}
Parameters: dictionary (dict) – dictionary, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator
-
static
load_from_file
(file_name)[source]¶ Load paulis in a file to construct an Operator, only support paulis as an input and its coefficient is real. E.g.:
IIII 0.34511 ZZZZ 0.31256 XXYY 5.84215 …Parameters: file_name (str) – path to the file, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator class
-
matrix
¶ Getter of matrix; if matrix is diagonal, diagonal matrix is returned instead.
-
num_qubits
¶ number of qubits required for the operator.
Returns: number of qubits Return type: int
-
paulis
¶ Getter of Pauli list.
-
print_operators
(print_format='paulis')[source]¶ Print out the paulis in the selected representation.
Parameters: print_format (str) – “paulis”, “grouped_paulis”, “matrix” Returns: a formated operator. Return type: str Raises: ValueError
– if print_format is not supported.
-
static
qubit_tapering
(operator, cliffords, sq_list, tapering_values)[source]¶ Builds an Operator which has a number of qubits tapered off, based on a block-diagonal Operator built using a list of cliffords. The block-diagonal subspace is an input parameter, set through the list tapering_values, which takes values +/- 1.
Parameters: - operator (Operator) – the target operator to be tapered
- cliffords ([Operator]) – list of unitary Clifford transformation
- sq_list ([int]) – position of the single-qubit operators that anticommute
- the cliffords (with) –
- tapering_values ([int]) – array of +/- 1 used to select the subspace. Length
- to be equal to the length of cliffords and sq_list (has) –
Returns: the tapered operator
Return type:
-
reorder_paulis
(grouping=None)[source]¶ Reorder the pauli terms according to the specified grouping.
Parameters: grouping (str) – The name of the grouping, currently supports ‘random’ and ‘default’. ‘random’ corresponds to the order of Operator.paulis; ‘default’ corresponds to the grouping as specified by Operator.grouped_paulis Returns: The list of pauli terms as ordered per the specified grouping Return type: list
-
representations
¶ Return the available represnetations in the Operator.
Returns: available representations ([str]) Return type: list
-
static
row_echelon_F2
(matrix_in)[source]¶ Computes the row Echelon form of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: matrix_in in Echelon row form Return type: np.ndarray
-
save_to_dict
()[source]¶ Save operator to a dict in pauli represnetation.
Returns: a dictionary contains an operator with pauli representation. Return type: dict
-
save_to_file
(file_name)[source]¶ Save operator to a file in pauli representation.
Parameters: file_name (str) – path to the file
-
two_qubit_reduced_operator
(m, threshold=1e-13)[source]¶ Eliminates the central and last qubit in a list of Pauli that has diagonal operators (Z,I) at those positions
Chemistry specific method: It can be used to taper two qubits in parity and binary-tree mapped fermionic Hamiltonians when the spin orbitals are ordered in two spin sectors, (block spin order) according to the number of particles in the system.
Parameters: - m (int) – number of fermionic particles
- threshold (float) – threshold for Pauli simplification
Returns: a new operator whose qubit number is reduced by 2.
Return type:
-
-
class
qiskit_aqua.
QuantumAlgorithm
(configuration=None)[source]¶ Bases:
abc.ABC
-
EQUIVALENT_BACKENDS
= {'local_qasm_simulator_cpp': 'local_qasm_simulator', 'local_qasm_simulator_projectq': 'local_qasm_simulator', 'local_qasm_simulator_py': 'local_qasm_simulator', 'local_statevector_simulator_cpp': 'local_statevector_simulator', 'local_statevector_simulator_projectq': 'local_statevector_simulator', 'local_statevector_simulator_py': 'local_statevector_simulator', 'local_statevector_simulator_sympy': 'local_statevector_simulator'}¶ Base class for Algorithms.
This method should initialize the module and its configuration, and use an exception if a component of the module is available.
Parameters: configuration (dict) – configuration dictionary
-
MAX_CIRCUITS_PER_JOB
= 300¶
-
SECTION_KEY_ALGORITHM
= 'algorithm'¶
-
SECTION_KEY_FEATURE_EXTRACTION
= 'feature_extraction'¶
-
SECTION_KEY_INITIAL_STATE
= 'initial_state'¶
-
SECTION_KEY_IQFT
= 'iqft'¶
-
SECTION_KEY_OPTIMIZER
= 'optimizer'¶
-
SECTION_KEY_ORACLE
= 'oracle'¶
-
SECTION_KEY_VAR_FORM
= 'variational_form'¶
-
UNSUPPORTED_BACKENDS
= ['local_unitary_simulator', 'local_clifford_simulator']¶
-
configuration
¶ Return algorithm configuration
-
execute
(circuits)[source]¶ A wrapper for all algorithms to interface with quantum backend.
Parameters: circuits (QuantumCircuit or list[QuantumCircuit]) – circuits to execute Returns: Result objects it will be a list if number of circuits exceed the maximum number (300) Return type: Result or [Result]
-
qconfig
¶ Return Qconfig configuration
-
random
¶ Return a numpy random
-
random_seed
¶ Return random seed
-
setup_quantum_backend
(backend='local_statevector_simulator', shots=1024, skip_transpiler=False, noise_params=None, coupling_map=None, initial_layout=None, hpc_params=None, basis_gates=None, max_credits=10, timeout=None, wait=5)[source]¶ Setup the quantum backend.
Parameters: - backend (str) – name of selected backend
- shots (int) – number of shots for the backend
- skip_transpiler (bool) – skip most of the compile steps and produce qobj directly
- noise_params (dict) – the noise setting for simulator
- coupling_map (list) – coupling map (perhaps custom) to target in mapping
- initial_layout (dict) – initial layout of qubits in mapping
- hpc_params (dict) – HPC simulator parameters
- basis_gates (str) – comma-separated basis gate set to compile to
- max_credits (int) – maximum credits to use
- timeout (float or None) – seconds to wait for job. If None, wait indefinitely.
- wait (float) – seconds between queries
Raises: AlgorithmError
– set backend with invalid Qconfig
-
-
qiskit_aqua.
local_pluggables_types
()[source]¶ Accesses all pluggable types :returns: pluggable types :rtype: types
-
qiskit_aqua.
local_pluggables
(pluggable_type)[source]¶ Accesses pluggable names :param pluggable_type: The pluggable type :type pluggable_type: str
Returns: pluggable names Return type: names Raises: AlgorithmError
– if the tyoe is not registered
-
qiskit_aqua.
get_pluggable_configuration
(pluggable_type, pluggable_name)[source]¶ Accesses pluggable configuration :param pluggable_type: The pluggable type :type pluggable_type: str :param pluggable_name: The pluggable name :type pluggable_name: str
Returns: pluggable configuration Return type: configuration Raises: AlgorithmError
– if the class is not registered
-
qiskit_aqua.
register_algorithm
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_algorithm
(name)¶
-
qiskit_aqua.
get_algorithm_class
(name)¶
-
qiskit_aqua.
get_algorithm_instance
(name)¶
-
qiskit_aqua.
get_algorithm_configuration
(name)¶
-
qiskit_aqua.
local_algorithms
()¶
-
qiskit_aqua.
register_optimizer
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_optimizer
(name)¶
-
qiskit_aqua.
get_optimizer_class
(name)¶
-
qiskit_aqua.
get_optimizer_instance
(name)¶
-
qiskit_aqua.
get_optimizer_configuration
(name)¶
-
qiskit_aqua.
local_optimizers
()¶
-
qiskit_aqua.
register_variational_form
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_variational_form
(name)¶
-
qiskit_aqua.
get_variational_form_class
(name)¶
-
qiskit_aqua.
get_variational_form_instance
(name)¶
-
qiskit_aqua.
get_variational_form_configuration
(name)¶
-
qiskit_aqua.
local_variational_forms
()¶
-
qiskit_aqua.
register_initial_state
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_initial_state
(name)¶
-
qiskit_aqua.
get_initial_state_class
(name)¶
-
qiskit_aqua.
get_initial_state_instance
(name)¶
-
qiskit_aqua.
get_initial_state_configuration
(name)¶
-
qiskit_aqua.
local_initial_states
()¶
-
qiskit_aqua.
register_iqft
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_iqft
(name)¶
-
qiskit_aqua.
get_iqft_class
(name)¶
-
qiskit_aqua.
get_iqft_instance
(name)¶
-
qiskit_aqua.
get_iqft_configuration
(name)¶
-
qiskit_aqua.
local_iqfts
()¶
-
qiskit_aqua.
register_oracle
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_oracle
(name)¶
-
qiskit_aqua.
get_oracle_class
(name)¶
-
qiskit_aqua.
get_oracle_instance
(name)¶
-
qiskit_aqua.
get_oracle_configuration
(name)¶
-
qiskit_aqua.
local_oracles
()¶
-
qiskit_aqua.
register_feature_extraction
(cls, configuration=None)¶
-
qiskit_aqua.
deregister_feature_extraction
(name)¶
-
qiskit_aqua.
get_feature_extraction_class
(name)¶
-
qiskit_aqua.
get_feature_extraction_instance
(name)¶
-
qiskit_aqua.
get_feature_extraction_configuration
(name)¶
-
qiskit_aqua.
local_feature_extractions
()¶
-
qiskit_aqua.
run_algorithm
(params, algo_input=None, json_output=False)[source]¶ Run algorithm as named in params, using params and algo_input as input data and returning a result dictionary
Parameters: - params (dict) – Dictionary of params for algo and dependent objects
- algo_input (algorithminput) – Main input data for algorithm. Optional, an algo may run entirely from params
- json_output (bool) – False for regular python dictionary return, True for json conversion
Returns: Result dictionary containing result of algorithm computation
-
qiskit_aqua.
run_algorithm_to_json
(params, algo_input=None, jsonfile='algorithm.json')[source]¶ Run algorithm as named in params, using params and algo_input as input data and save the combined input as a json file. This json is self-contained and can later be used as a basis to call run_algorithm
Parameters: - params (dict) – Dictionary of params for algo and dependent objects
- algo_input (algorithminput) – Main input data for algorithm. Optional, an algo may run entirely from params
- jsonfile (string) – Name of file in which json should be saved
Returns: Result dictionary containing the jsonfile name
-
class
qiskit_aqua.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source] Bases:
object
-
MAX_CIRCUITS_PER_JOB
= 300 Operators relevant for quantum applications
Note
For grouped paulis represnetation, all operations will always convert it to paulis and then convert it back. (It might be a performance issue.)
-
__init__
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source] Parameters: - paulis ([[float, Pauli]]) – each list contains a coefficient (real number) and a corresponding Pauli class object.
- grouped_paulis ([[[float, Pauli]]]) – each list of list contains a grouped paulis.
- matrix (numpy.ndarray or scipy.sparse.csr_matrix) – a 2-D sparse matrix represents operator (using CSR format internally)
- coloring (bool) – method to group paulis.
-
chop
(threshold=1e-15)[source] Eliminate the real and imagine part of coeff in each pauli by threshold. If pauli’s coeff is less then threshold in both real and imagine parts, the pauli is removed. To align the internal representations, all available representations are chopped. The chopped result is stored back to original property. Note: if coeff is real-only, the imag part is skipped.
Parameters: threshold (float) – threshold chops the paulis
-
coloring
Getter of method of grouping paulis
-
construct_evolution_circuit
(slice_pauli_list, evo_time, num_time_slices, state_registers, ancillary_registers=None, ctl_idx=0, unitary_power=None, use_basis_gates=True)[source] Construct the evolution circuit according to the supplied specification.
Parameters: - slice_pauli_list (list) – The list of pauli terms corresponding to a single time slice to be evolved
- evo_time (int) – The evolution time
- num_time_slices (int) – The number of time slices for the expansion
- state_registers (QuantumRegister) – The Qiskit QuantumRegister corresponding to the qubits of the system
- ancillary_registers (QuantumRegister) – The optional Qiskit QuantumRegister corresponding to the control qubits for the state_registers of the system
- ctl_idx (int) – The index of the qubit of the control ancillary_registers to use
- unitary_power (int) – The power to which the unitary operator is to be raised
- use_basis_gates (bool) – boolean flag for indicating only using basis gates when building circuit.
Returns: The Qiskit QuantumCircuit corresponding to specified evolution.
Return type: QuantumCircuit
-
convert
(input_format, output_format, force=False)[source] A wrapper for conversion among all representations. Note that, if the output target is already there, it will skip the conversion. The result is stored back into its property directly.
Parameters: - input_format (str) – case-insensitive input format, should be one of “paulis”, “grouped_paulis”, “matrix”
- output_format (str) – case-insensitive output format, should be one of “paulis”, “grouped_paulis”, “matrix”
- force (bool) – convert to targeted format regardless its present.
Raises: ValueError
– if the unsupported output_format is specified.
-
disable_summarize_circuits
()[source]
-
enable_summarize_circuits
()[source]
-
eval
(operator_mode, input_circuit, backend, execute_config={}, qjob_config={})[source] Supporting three ways to evaluate the given circuits with the operator. 1. If input_circuit is a numpy.ndarray, it will directly perform inner product with the operator. 2. If backend is a statevector simulator, use quantum backend to get statevector
and then evaluate with the operator.- Other cases: it use with quanutm backend (simulator or real quantum machine), to obtain the mean and standard deviation of measured results.
Parameters: - operator_mode (str) – representation of operator, including paulis, grouped_paulis and matrix
- input_circuit (QuantumCircuit or numpy.ndarray) – the quantum circuit.
- backend (str) – backend selection for quantum machine.
- execute_config (dict) – execution setting to quautum backend, refer to qiskit.wrapper.execute for details.
- qjob_config (dict) – the setting to retrieve results from quantum backend, including timeout and wait.
Returns: mean and standard deviation of avg
Return type: float, float
-
evolve
(state_in, evo_time, evo_mode, num_time_slices, quantum_registers=None, paulis_grouping='random', expansion_mode='trotter', expansion_order=1)[source] Carry out the dynamics evolution for the operator under supplied specifications.
Parameters: - state_in – The initial state for the evolution
- evo_time (int) – The evolution time
- evo_mode (str) – The mode under which the evolution is carried out. Currently only support ‘matrix’ or ‘circuit’
- num_time_slices (int) – The number of time slices for the expansion
- quantum_registers (QuantumRegister) – The QuantumRegister to build the QuantumCircuit off of
- paulis_grouping (str) – The grouping to dictate the ordering of the pauli terms. See reorder_paulis method for more details.
- expansion_mode (str) – The mode under which the expansion is to be done. Currently support ‘trotter’, which follows the expansion as discussed in http://science.sciencemag.org/content/273/5278/1073, and ‘suzuki’, which corresponds to the discussion in https://arxiv.org/pdf/quant-ph/0508139.pdf
- expansion_order (int) – The order for suzuki expansion
Returns: Depending on the evo_mode specified, either return the matrix vector multiplication result or the constructed QuantumCircuit.
-
find_Z2_symmetries
()[source] Finds Z2 Pauli-type symmetries of an Operator
Returns: the list of Pauli objects representing the Z2 symmetries [Pauli]: the list of single - qubit Pauli objects to construct the Cliffors operators [Operators]: the list of Clifford unitaries to block diagonalize Operator [int]: the list of support of the single-qubit Pauli objects used to build the clifford operators Return type: [Pauli]
-
grouped_paulis
Getter of grouped Pauli list.
-
is_empty
()[source] Check Operator is empty or not.
Returns: is empty? Return type: bool
-
static
kernel_F2
(matrix_in)[source] Computes the kernel of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: the list of kernel vectors Return type: [np.ndarray]
-
static
load_from_dict
(dictionary)[source] Load paulis in a dict to construct an Operator, the dict must be represented as follows: label and coeff (real and imag). E.g.:
- {‘paulis’:
- [
- {‘label’: ‘IIII’,
- ‘coeff’: {‘real’: -0.33562957575267038, ‘imag’: 0.0}},
- {‘label’: ‘ZIII’,
- ‘coeff’: {‘real’: 0.28220597164664896, ‘imag’: 0.0}}, …
]
}
Parameters: dictionary (dict) – dictionary, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator
-
static
load_from_file
(file_name)[source] Load paulis in a file to construct an Operator, only support paulis as an input and its coefficient is real. E.g.:
IIII 0.34511 ZZZZ 0.31256 XXYY 5.84215 …Parameters: file_name (str) – path to the file, which contains a list of Paulis and coefficients. Returns: the loaded operator. Return type: Operator class
-
matrix
Getter of matrix; if matrix is diagonal, diagonal matrix is returned instead.
-
num_qubits
number of qubits required for the operator.
Returns: number of qubits Return type: int
-
paulis
Getter of Pauli list.
-
print_operators
(print_format='paulis')[source] Print out the paulis in the selected representation.
Parameters: print_format (str) – “paulis”, “grouped_paulis”, “matrix” Returns: a formated operator. Return type: str Raises: ValueError
– if print_format is not supported.
-
static
qubit_tapering
(operator, cliffords, sq_list, tapering_values)[source] Builds an Operator which has a number of qubits tapered off, based on a block-diagonal Operator built using a list of cliffords. The block-diagonal subspace is an input parameter, set through the list tapering_values, which takes values +/- 1.
Parameters: - operator (Operator) – the target operator to be tapered
- cliffords ([Operator]) – list of unitary Clifford transformation
- sq_list ([int]) – position of the single-qubit operators that anticommute
- the cliffords (with) –
- tapering_values ([int]) – array of +/- 1 used to select the subspace. Length
- to be equal to the length of cliffords and sq_list (has) –
Returns: the tapered operator
Return type:
-
reorder_paulis
(grouping=None)[source] Reorder the pauli terms according to the specified grouping.
Parameters: grouping (str) – The name of the grouping, currently supports ‘random’ and ‘default’. ‘random’ corresponds to the order of Operator.paulis; ‘default’ corresponds to the grouping as specified by Operator.grouped_paulis Returns: The list of pauli terms as ordered per the specified grouping Return type: list
-
representations
Return the available represnetations in the Operator.
Returns: available representations ([str]) Return type: list
-
static
row_echelon_F2
(matrix_in)[source] Computes the row Echelon form of a binary matrix on the binary finite field
Parameters: matrix_in (np.ndarray) – binary matrix Returns: matrix_in in Echelon row form Return type: np.ndarray
-
save_to_dict
()[source] Save operator to a dict in pauli represnetation.
Returns: a dictionary contains an operator with pauli representation. Return type: dict
-
save_to_file
(file_name)[source] Save operator to a file in pauli representation.
Parameters: file_name (str) – path to the file
-
two_qubit_reduced_operator
(m, threshold=1e-13)[source] Eliminates the central and last qubit in a list of Pauli that has diagonal operators (Z,I) at those positions
Chemistry specific method: It can be used to taper two qubits in parity and binary-tree mapped fermionic Hamiltonians when the spin orbitals are ordered in two spin sectors, (block spin order) according to the number of particles in the system.
Parameters: - m (int) – number of fermionic particles
- threshold (float) – threshold for Pauli simplification
Returns: a new operator whose qubit number is reduced by 2.
Return type:
-
zeros_coeff_elimination
()[source] Elinminate paulis or grouped paulis whose coefficients are zeros.
The difference from _simplify_paulis method is that, this method will not remove duplicated paulis.
-


---
layout: post
title: 40 Tips from Tom Kyte
date: '2007-03-09T23:19:00.000-06:00'
author: Don Seiler
tags:
- tkyte
- oracle
modified_time: '2010-11-19T22:48:47.189-06:00'
blogger_id: tag:blogger.com,1999:blog-7032512792942232766.post-4602009521306569070
blogger_orig_url: http://www.seiler.us/2007/03/40-tips-from-tom-kyte.html
---
Robert Vollman, via his oracleblog, offers a great list of 40 Tips from Tom, collected from just the articles updated this past week on AskTom. Definitely worth reading as well as following the links to the actual AskTom articles.
P.S. -- Just in case you didn't know, "Tom" is Tom Kyte.


If we evaluate the expression 5 % 2 we get the value 1. What does 1 represent?
The remainder of dividing 5 by 2
- The quotient of dividing 5 by 2
- This statement is incorrect - 5 % 2 is 2.5
- This statement is incorrect - it would cause a syntax error
There are no hints for this question


| Logo | Team | Position | Points | Played Games | Won | Draw | Lost | Goals for | Goals Against | Goal Difference |
|---|---|---|---|---|---|---|---|---|---|---|
| {{row.team.name}} | {{row.position}} | {{row.points}} | {{row.playedGames}} | {{row.won}} | {{row.draw}} | {{row.lost}} | {{row.goalsFor}} | {{row.goalsAgainst}} | {{row.goalDifference}} |


LAVis 2.0
Amlan Saha Kundu
CONTROLS
Lite Mode
( left-click + drag )
Rotate X-Y axes
( middle-click + drag )
Translate X-Y axes
( shift + click + drag )
Rotate / Translate Z axis
( mousewheel )
Zoom in / Zoom out
( spacebar )
Pause / Play
a
Add solution with random initial value
x
Clear all solutions
F5
Reset to Default
h
Toggle head (point) visibility
[
Decrease tail length
]
Increase tail length
VISUALIZATION
-- click here to select--
Chaos
Rotation
Tail length =
σ =
β =
ρ =


importance: 5
Create JS-code for the tooltip behavior.
When a mouse comes over an element with data-tooltip
, the tooltip should appear over it, and when it’s gone then hide.
An example of annotated HTML:
<button data-tooltip="the tooltip is longer than the element">Short button</button>
<button data-tooltip="HTML<br>tooltip">One more button</button>
Should work like this:
[iframe src=“solution” height=200 border=1]
In this task we assume that all elements with data-tooltip
have only text inside. No nested tags (yet).
Details:
5px
.data-tooltip
attribute. It can be arbitrary HTML.You’ll need two events here: - mouseover
triggers when a pointer comes over an element. - mouseout
triggers when a pointer leaves an element.
Please use event delegation: set up two handlers on document
to track all “overs” and “outs” from elements with data-tooltip
and manage tooltips from there.
After the behavior is implemented, even people unfamiliar with JavaScript can add annotated elements.
P.S. Only one tooltip may show up at a time.


Usage
First specify a container in your html files like this(remember to refer necessary files):

Then initialize the social sharing components in your JavaScript file like this:
$("#container").hshare();
You can also specify options for hshare like this:
$("#container").hshare({
size: "large",
copyLink: false,
platforms: [{
name: "wechat"
}, {
name: "qzone"
}]
});
All configurable params is listed below:
| name | type | meaning | value | defaultValue |
|---|---|---|---|---|
| size | string | size of the icon | small/medium/large | medium |
| copyLink | boolean | if a copyLink sharing entry is included | true/false | false |
| boolean | if a printing entry is included | true/false | false | |
| bookmark | boolean | if a bookmark entry is included | true/false | false |
| more | boolean | if a "more" panel will be included | true/false | false |
| renderText | boolean | if text will be shown | true/false | false |
| platforms | Array | customized shown platforms | --- | undefined |
| extends | Array | customized platforms shown in the "more" panel | --- | undefined |
| stat | Object | if statistics port is enabled | --- | undefined |
Explanation
- copyLink: this param specifies an entry. Clicking it will enable user to copy the url of current page into clipboard.
- print: this param specifies an entry. Clicking it will allow user to print current webpage.
- bookmark: this param specifies an entry. Clicking it and an alert will be shown, telling user to use "Ctrl + D" to put the webpage into their browsers favorite list.'
- more: since we support 40 platforms, show all platforms in a single line is likely to mess up the whole page. So we include a "more" entry, which is a "..." icon by default. When the cursor hovers above the entry, a panel including all the rest supported platforms will show up.
- size: To make sure that the text will be shown properly, if renderText is set to true, then no matter what value that size param carries, the rendered icon size will always be "small"
More
- Supported Platforms is shown in Supported platforms
- Displayed platforms is configurable freely. Detail is shown in More Entry


Dear {{ person.first_name }}
A '{{ application_name }}' application has been assign to you for feedback. You can view the application by logging in here
Direct Link : {{ default_url }}{% url 'application_detail' application_id %}
Kind Regards
Department of Parks and Wildlife
Bob Parks


Header Builder
This theme has an easy to use and comprehensive header layout builder, meaning you can create over 40 different header layout combinations allowing you to achieve almost any major header layout.
Pre, Main & Post Areas
Our Header Builder is a 3 tier system that made up of a Pre-Header area, a Main-Header area and a Post-Header area. Each one of these area’s can be used alone or in combination with each other.
Header Area Layouts
Each header area can be be assigned different layout. The layout options consist of Left and Right or Center positions.
You can can assign an element to any of these selected positions in your selected header area.
More Options Include:
- Sticky header area's
- Header scroll reveal's
- Full width or boxed header Area's
- Transparent overlay headers
- Header area hidden panels
Your Logo
Or Phone Number
Quick Menu Maybe
Date Countdown ?
Bread Crumbs
Maybe Search
Ad Banner?
Or Main Menu
Social Icons, done.
 Primary Menu
The Primary Menu is your main site menu that your top level pages are featured in.
02. Secondary Menu
The Secondary Menu is a handy suplimentary menu that you don’t want in the primary.
03. Logo
What more to say, it’s your logo. Either use a logo image or type text and a tagline.
04. Social Icons
The social icons display the social networks icons you want, icons available part as Font Awesome.
05. Ad Banner
An area for you to place a leaderboard or ad image to promote or monetise your site.
06. Breadcrumbs
Handy for backtracking. Leave a trail and let you users know where they are in your site.
07. Countdown
Save the date. The countdown will display an important date and inform you of how long to go.
08. Search
Easy peasy search. Just a simple search field to the main menu system or by its self.
09. Header Text
Great for phone numbers, address’, custom links, basically any text or html you want to include.
10. Cart
Have a store? Add a quick cart summary and link to the check out in your header.
11. Slidebars
Got extra content to display, put in in a "Slide Bar", a hidden panel that displays when needed.
12. Feature Overlay
More hidden content. Include buttons or icons that triggers an overlay feature to house any content.


Some soft drinks
Some soft drinks
Select the type of drinks
Type of drinks are displayed
Select
Type 1
Type 2
Type 3
Type 4
Type 5
Price


Toggle navigation
Washmates Administration
New Comment
4 minutes ago
Message Sent
4 minutes ago
New Order
4 minutes ago
See All Alerts
User Profile
Settings
Logout
Dashboard
Calendar
Users
List of Users
Create New User
Laundries
Drivers
Orders
Issues
...
<< Prev
Today
Next >>
Year
Month
Week
Day
All Drivers
Create new schedule
×
Event
×
New Schedule
Driver
Select Driver
From
To
Recurr every:
Week Day
Weekend


Toggle navigation
JUST DENTAL
Help
About us
Contant us
Guest
×
Warning!
License for four clinics are about to expire.
50
Total Clinics
100
Doctors
124
Meeting with Clients
5
Clinics payment due
Data insight
Shortcuts
Detailed Reports
4 minutes ago
3 New Followers
12 minutes ago
Message Sent
27 minutes ago
New Task
43 minutes ago
Server Rebooted
11:32 AM
Server Crashed!
11:13 AM
Server Not Responding
10:57 AM
New Order Placed
9:49 AM
Payment Received
Yesterday
View All Alerts


Funding. The authors would like to thank the Deanship of Scientific Research for funding the study through the research Group Project No. RGP-190.


I was working as a Vet Tech. in a small animal hospital that was not very well run. When I started, I had no idea what Ketamine was or what it does. But within a couple months of regularly using it on cats and dogs before surgery (and during), I started to research it and found what sort of dose I could take.
Things have changed since I quit, but while there, I had practically unlimited access to Ketamine- we would purchase a huge order- 100s of bottles- and no one kept track of a damn thing. They were just in a big plastic bag in a unlocked box under the surgery table. I took home bottles almost every night.
Always injected it IM- hits me really fast, almost before the needle is out. I usually used the fatty part of my upper arm but it soon had so many hematoma knots that I bled way too much, so I also had to use my thighs. Seriously- sometimes I would take the needle out any the blood would literally shoot out of my arm.
I have plenty of experience with weed, acid, shrooms, mescaline, narcotics, other pharms., and coke, but nothing compare to ketamine. Not that it's better by any means, just different. It's definitely not a social/party drug, at least not in the amounts I was doing.  I could not walk, see, think. But it's not a drug I can freak out on either (again- not in the amounts I was doing) because it is a Dissociative- totally opposite of say, acid, where everything is sharpened, so to speak.
So it would make me feel good (or bad) like coke or pot. It certainly doesn't heighten the senses.  I think I just enjoyed the needles (I would become an instant junkie if I ever did dope) and it did make me feel like my insides were swirling through themselves. This was rather cool- I remember laying on my bed, totally still, just feeling my body roll over into itself like I was completely made of liquid.  But I can't remember any specifics- I was just too unconscious really.
I shot it into a couple friends' arms who absolutely hated it so I guess it's not for eveyone.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


| Returns the angle from the X axis to a point (y,x). |
| float = floating point value (degrees) |
Command Description:
| Aside from its basic trig usage, this nifty command will allow you to derive an angle based on the x and y speed of a travelling object. Also see ATan2. |
Example:
| ; Set graphics w/double buffering Graphics 640,480,16,0 SetBuffer BackBuffer() ; Starting point for our travelling box x=0 y=0 ; random speed values for travelling xSpeed#=Rand(5) ySpeed#=Rand(5) ; repeat until the ESC or box travels off the screen While Not KeyHit(1) Or y > 480 Or x > 640 Cls ; Draw our box Rect x,y,10,10,1 ; increment the box location based on random speed x=x+xSpeed y=y+yspeed ; print the angle of our box travel Text 0,0,ATan(yspeed/xspeed) Flip Wend |


--- layout: post title: Really? Bamboo needs permission to check out code? date: 2014-01-07 11:38:22.000000000 +00:00 type: post published: true status: publish categories: [] tags: - bamboo - public shaming - stash meta: _edit_last: '1' _syntaxhighlighter_encoded: '1' tmac_last_id: '618797329773129729' author: David Simpson excerpt_separator: ---
Yet again I'm trying to work out why my new build plan on Bamboo isn't working. All the configuration details are good, but Bamboo can't access the repo. Apparently it doesn't exist. What?
Here's part of the stack trace displayed in Bamboo:
Caused by: com.atlassian.bamboo.repository.RepositoryException: Runtime exception.
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:285)
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:186)
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:475)
at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager$1.call(DefaultChangeDetectionManager.java:471)
at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108)
... 32 more
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: com.atlassian.bamboo.plugins.git.GitCommandException: command /opt/git/current/bin/git ls-remote ssh://f1ca42c1-202b-4319-b86f-ce49828e3bc7@<IP_ADDRESS>:66102/splendid/spliffing-product.git failed with code 128. Working directory was [.]., stderr:
[Warning: Permanently added '[<IP_ADDRESS>]:66102' (RSA) to the list of known hosts., fatal: remote error: Repository does not exist, The requested repository does not exist, or you do not have permission to, access it., fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.]
at com.google.common.cache.AbstractCache.getUnchecked(AbstractCache.java:51)
at com.atlassian.bamboo.plugins.git.CallableResultCache.call(CallableResultCache.java:82)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.getRemoteRefs(NativeGitOperationHelper.java:464)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.resolveBranch(NativeGitOperationHelper.java:399)
at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.obtainLatestRevision(NativeGitOperationHelper.java:497)
at com.atlassian.bamboo.plugins.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:198)
... 36 more
Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command /opt/git/current/bin/git ls-remote ssh://f1ca42c1-202b-4319-b86f-ce49828e3bc7@<IP_ADDRESS>:66102/splendid/spliffing-product.git failed with code 128. Working directory was [.]., stderr:
[Warning: Permanently added '[<IP_ADDRESS>]:66102' (RSA) to the list of known hosts., fatal: remote error: Repository does not exist, The requested repository does not exist, or you do not have permission to, access it., fatal: Could not read from remote repository., , Please make sure you have the correct access rights, and the repository exists.]
at com.atlassian.bamboo.plugins.git.GitCommandProcessor.runCommand(GitCommandProcessor.java:496)
at com.atlassian.bamboo.plugins.git.GitCommandProcessor.getRemoteRefs(GitCommandProcessor.java:416)
Oh, wait a minute, "you do not have permission to, access it", crap. It's that again.
OK, that's easy to fix. We're using a dedicated Bamboo user to access the repo. I bet I haven't added permissions for that user in my Stash project.
There we go. Added. Guess what, my build works just dandy now.
 Maybe a public shaming blog post will remind me for next time.
So, on to release plans... Having got the CI build working nicely, I need to also remember little aspects of releasing.

Command output:
*** Please tell me who you are.
Run
git config --global user.email<EMAIL_ADDRESS>git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: empty ident name (for<EMAIL_ADDRESS>not allowed
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
Browse to your release job, Maven task...
Add something similar to this in Environment variables:
GIT_AUTHOR_NAME=Bamboo<EMAIL_ADDRESS>GIT_COMMITTER_NAME=Bamboo GIT_COMMITTER_EMAIL=bamboo@example.com


### Alpha ~~Shogi~~ Connect 4 Shane & Noah
### History of Chess Programs - Long been a focus of artificial intelligence research - Alan Turing developed one in 1956 - Two years before "Artificial Intelligence" existed
### Why? Branching factor makes normal evaluation intractable ![](image/branching_factor.jpg)
### 62 years later - Relied on data of human-played games - Human coded features - Collaboration wih grandmasters - Studying openings
### AlphaGo - Combine deep learning and reinforcement learning - Start by learning famous openings/endgame until the neural network learns them. - Go is translationally invariant, meaning is the same wherever something is placed. ![](image/translational_invariance.png)
### AlphaGo - Points are defined in terms of liberties, (which are largely local) - No draws in Go, only binary wins and losses (simpler loss function) Training wheel approach 1. Bootstrap network with supervised learning on "real" games 2. Once developed, extend abilities with reinforcement learning
### Alpha Zero: Removing the training wheels - No human games included to do supervised learning on - Only raw board added as input, not human-curated features - Policy network and value network combined into a single residual network - *Only* uses reinforcement learning, starting from playing random moves.
### How AlphaZero works with Connect 4 (Assuming Batch Size of 1 for simplicity)
### Input - (MT + L) stack of NxN images - N is board size - M is the number of planes needed for pieces - T is the step-history, set to 8 by default - L is a number of constant valued input planes, denoting character color, total move count, and special rules (for chess, this would be whether castling was an option, or whether a draw was coming)
### Connect 4 input - (1 * 1 + 0) stack of 6x7 images Only one piece type allows us to use one input plane - 1 and -1 to determine color - 0 to indicate empty square
### Hidden Layer Architecture - Really the only place the algorithm loses generality - Varies from game to game - For a simple games with small boards and one piece type, something like four convolutional layers and two fully connected layers is almost overkill - For complex games like chess, 20 residual layers with 2 convolutional layers a piece is a minimum
### First Convolutional Layer - 3x3 convolutional kernel - One 6 by 7 input feature plane - 512 different kernels and convolutions produce 512 output planes of the same size - ReLu activation function - Batch Normalization - 9 * 512 = 4608 weights
### Second Convolutional Layer - Same as the first - Each of the 512 input planes has a single convolution applied to it, producing 512 output planes of the same size
### Third Convolutional Layer - Convolution without padding - 3x3 kernel cuts off 1 unit margins - 512 output planes of size 4 x 5
### Fourth Convolutional Layer - Again a convolution without padding - 512 output planes of size 2 x 3
### Two Fully Connected Layers - The 4th convolutional layer planes are flattened and stacked together - Two fully connected layers attach to that, bringing the size down first to 1024 and then to 512 (again arbitrary numbers) - ReLu activation functions, with batch norm and dropout - This is the final hidden layer output
### Output (Policy Vector) - One of two output heads - A fully connected layer connects to the last hidden layer - Softmax used to create probability distribution over neurons - Each neuron represents one action - For chess, there are over 6,000 of these - For Connect 4, there are 7 (one per column) ![](image/neural_net_layer.png)
### Output (Policy Vector) Probability is assigned to each option, with the highest probability being the chosen neuron ![](image/fired_neuron.png)
### Rules are defined for logical masking - Neural network doesn't know anything specific about the rules - Means it can recommend illegal moves
![](image/full_column.png)
![](image/illegal_man.png) - The illegal value is forced to 0, and the the probabilities are renormalized
### Output (Value Network) - A separate output head which connects to the last hiddden layer - Predicts the winner of the game from any board state - A simple fully connected layer with a hyperbolic tangent activation function - Tanh smushes the output into a single scalar value [-1, 1] - 1 certain win - -1 certain loss
### Loss Functions - Get total loss by adding policy vector loss and value network loss - v(s) is the network's value output for board state s - p(s) is the network's policy vector output - z is the eventual result (win/loss) - pi is the improved stochastic policy vector from MCTS ![](image/loss_function.png)
### Loss Functions - Training examples are summed over a batch of examples - This batch is randomly selected from past data ![](image/loss_function.png)
### Generating Examples - Where does this data come from? - Self-play games - At every turn, save (s, pi, z) - z is filled in after the game concludes
### Batch Size - Previously we described the network with a batch size of 1 - To compute sums efficiently the actual network is extended to handle arbitrary batch sizes - All inputs and outputs through every layer have a batch_size dimension added - Batch size policy vectors and values
### Training - Adam Optimizer acts on batches - Extension of Stochastic Gradient Descent - Separate learning rates for every network parameter ![](image/loss_function.png)
### What's the point? - The branching factor makes traditional search methods choke - How does AlphaZero make search *tractable*? - How do the policy vector and value vector help?
### Reduce Breadth - Policy Network reduces breadth - If search only considers moves based on the policy network, there's much less trees to expand and evaluate
### Reduce Depth - Value network takes in board state and outputs probability of victory - At any point, we can use the value network to replace any search tree value with one number. - So we can truncate any leaf of the tree without rolling it out to completion
### Monto-Carlo Tree Search - Uses current neural network to guide tree search - Compress everything achieved by tree search into neural network - Value network is trained to predict the winner of the game played by self play (based on each position of the game)
### Choosing a Network Structure ![](image/competition.gif)
### Choosing a Network Structure - The network is what varies from implementation to implementation - Generate 6 different models, allowing them all to train for the same amount of games - Pit them against each other in a tournament - The winner trains for multiple days
### Early failures - A trained model is only ever saved if it can defeat an opponent neural net initialized with random weights - We lost two in infancy: 1. We tried a 5x5 kernel for convolutional layers, which seemed too large for the 6x7 board "images" 2. Logit function instead of relu also died young
### Fighter 1 - The network already described, with 4 convolutional layers and 2 fully connected - "Stock"
### Fighter 2 - Leaky ReLu activation functions for all hidden layers - Leaky ReLu has a small positive gradient when x < 0 (e.g. 0.01*x) - "Leaky"
### Fighter 3 - Removed dropout from last two hidden dense layers - "No Dropout"
### Fighter 4 - Two additional hidden convolutional layers, with padding - "Big Boy"
### Colosseum - All 4 fighters trained for 1 iteration (100 self-play games) - Each fighter then played 50 matches against every other - In the end no fighter won more than 60% of games against any other
### Training - Stock and No-Dropout moved on to the finals - They were trained for a little less than a day - No-Dropout performed better as expected (less regularization) - Or 1300 matches
ONE MORE TIME
![](image/Alpha4_v_Gary.jpg)
Progress on Shogi side of things - Game logic is still being coded up - Network architecture is well in progress, something large like 20 residual layers with 2 convolutional layers a piece. - Probably need better hardware - (Were being told we're RAM hogs as is)
- Input size blows up - huge number of different kinds of pieces and special rules - Coding those up by hand is busy work in a way - Switched to get quicker training turnaround
### Questions?


| Project: | NS-ACEF |
|---|---|
| Internal Release Number: | 1.0 |
| Last update: | January 27, 2009 |
This document describes the functionalities of the software and the major constraints of development and exploitation. It plans the software design and development. It concerns users and software framework builders.
This project is a part of the following ANR project:
The goal of the project is to answer to the work package WP3 described in the VAL-AMS documents:
The first step consists in developing a tool able to get a circuit equation formulation from an electrical circuit description, that is a Nonsmooth Automatic Circuit Equation Formulation software (NS-ACEF).
The second step, the software must be able to perform the transient analysis using the Siconos platform.
NS-ACEF needs SICONOS to time integrate Complementarity systems (CS) and to solve Complementarity Problems (LCP, MLCP, NCP). The relation with the Siconos Software is sketched in the following figure
The project is currently under development.
| Existing circuit analysis | MNA | Presents the Modified Nodal Analysis (MNA) which is used in SPICE to automatically formulate circuit equations. |
|---|---|---|
| LCP circuit analysis | MNA adaptation | Describe how to adapt the MNA for a CS formulation. |
| Examples | Diode bridge | Validation the previous analysis. |
| Software Requirement Document. | Functionalities Feature details Delivery and release | Specification and user requirements. List of Software functionalities. It aims to define precisely the software to realize. It describes the functionalities and characteristics of the software and the constraints of development and exploitation. It plans the project developpement. |
|---|---|---|
| Architectural and detailed Design Document: | Architectual and detailed Design Details Design and spefication implementation | Definition of the software global architecture. Overview of the detailed implementation |
| Quality and Validation Plan | Tests Plan | Checks that the project is consistent |
| Software delivery | Delivery description | Describes the first delivery |


I spend every day at work making web apps so when it came down to making
a site for my upcoming wedding I wanted something simple. I decided to forego using any frameworks
or even using a database and instead make a single page - static site. Check it
out at zacharyandseyoung.com.
The goal of the design was convey all the information that our guests
would need - date, place, directions etc. Additionally though I wanted to make
sure that once guests traveled here they would have a great list of
things to do that didn’t involve the wedding and which would hopefully
give them an appreciation for the city that we love and call home.
I also wanted something that would look good on either a PC, tablet or
phone.
Some highlights:
The site itself is just html/css/js using bootstrap for its basic grid system
and mobile friendly responsiveness with some custom styling.
It uses some additional js that wasn’t included in stock bootstrap like fitvid.js for video
resizing and sticky.js for the navigation but over all I was able to accomplish what I wanted
much faster than without it.
The RSVP form is just a simple wufoo form that emails us when someone
registers.