qiskit_acqua package¶
Subpackages¶
- qiskit_acqua.classicalsvm package
- qiskit_acqua.dynamics package
- qiskit_acqua.exacteigensolver package
- qiskit_acqua.grover package
- qiskit_acqua.input package
- qiskit_acqua.iqpe package
- qiskit_acqua.ising package
- qiskit_acqua.parser package
- qiskit_acqua.qpe package
- qiskit_acqua.svm package
- Submodules
- qiskit_acqua.svm.cost_helpers module
- qiskit_acqua.svm.data_preprocess module
- qiskit_acqua.svm.qpsolver module
- qiskit_acqua.svm.quantum_circuit_kernel module
- qiskit_acqua.svm.quantum_circuit_variational module
- qiskit_acqua.svm.svm_qkernel module
- qiskit_acqua.svm.svm_variational module
- Module contents
- qiskit_acqua.ui package
- qiskit_acqua.utils package
- Subpackages
- qiskit_acqua.utils.initial_states package
- qiskit_acqua.utils.iqfts package
- qiskit_acqua.utils.optimizers package
- Subpackages
- Submodules
- qiskit_acqua.utils.optimizers.cg module
- qiskit_acqua.utils.optimizers.cobyla module
- qiskit_acqua.utils.optimizers.l_bfgs_b module
- qiskit_acqua.utils.optimizers.nelder_mead module
- qiskit_acqua.utils.optimizers.optimizer module
- qiskit_acqua.utils.optimizers.p_bfgs module
- qiskit_acqua.utils.optimizers.powell module
- qiskit_acqua.utils.optimizers.slsqp module
- qiskit_acqua.utils.optimizers.spsa module
- qiskit_acqua.utils.optimizers.tnc module
- Module contents
- qiskit_acqua.utils.oracles package
- qiskit_acqua.utils.variational_forms package
- Submodules
- qiskit_acqua.utils.decimal_to_binary module
- qiskit_acqua.utils.jsonutils module
- qiskit_acqua.utils.pauligraph module
- qiskit_acqua.utils.random_matrix_generator module
- qiskit_acqua.utils.subsystem module
- qiskit_acqua.utils.tensorproduct module
- Module contents
- Subpackages
- qiskit_acqua.vqe package
Submodules¶
qiskit_acqua.algomethods module¶
Algorithm functions for running etc.
-
qiskit_acqua.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_acqua.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_acqua.algorithmerror module¶
Exception for errors raised by the Algorithm SDK.
qiskit_acqua.operator module¶
-
class
qiskit_acqua.operator.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Bases:
object
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) – The boolean flag for specifying if only basis gates should be used
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.
-
grouped_paulis
¶ Getter of grouped Pauli list.
-
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 Note
Do we need to support complex coefficient? If so, what is the format?
-
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.
-
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
-
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_acqua.preferences module¶
qiskit_acqua.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_acqua.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
-
SECTION_KEY_ALGORITHM
= 'algorithm'¶
-
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
-
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, timeout=None, wait=5, noise_params=None)[source]¶ Setup the quantum backend.
Parameters: - backend (str) – name of selected backend
- shots (int) – number of shots for the backend
- skip_transpiler (bool) – flag of skipping gate mapping, be aware that only basis gates of the backend are executed others are skipped.
- timeout (float or None) – seconds to wait for job. If None, wait indefinitely.
- wait (float) – seconds between queries
- noise_params (dict) – the noise setting for simulator
Raises: AlgorithmError
– set backend with invalid Qconfig
-
Module contents¶
Algorithm discovery methods, Error and Base classes
-
qiskit_acqua.
get_qconfig
()[source]¶ Returns current Qconfog module if found :returns: Qconfig module :rtype: module
-
qiskit_acqua.
set_qconfig
(qconfig)[source]¶ Sets the Qconfig.py module. :param qconfig: Qconfig module :type qconfig: object
-
qiskit_acqua.
load_qconfig
()[source]¶ Attemps to load the Qconfig.py searching the current environment. :returns: Qconfig module :rtype: module
-
qiskit_acqua.
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_acqua.
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_acqua.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source]¶ Bases:
object
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) – The boolean flag for specifying if only basis gates should be used
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.
-
grouped_paulis
¶ Getter of grouped Pauli list.
-
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 Note
Do we need to support complex coefficient? If so, what is the format?
-
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.
-
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
-
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_acqua.
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
-
SECTION_KEY_ALGORITHM
= 'algorithm'¶
-
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
-
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, timeout=None, wait=5, noise_params=None)[source]¶ Setup the quantum backend.
Parameters: - backend (str) – name of selected backend
- shots (int) – number of shots for the backend
- skip_transpiler (bool) – flag of skipping gate mapping, be aware that only basis gates of the backend are executed others are skipped.
- timeout (float or None) – seconds to wait for job. If None, wait indefinitely.
- wait (float) – seconds between queries
- noise_params (dict) – the noise setting for simulator
Raises: AlgorithmError
– set backend with invalid Qconfig
-
-
qiskit_acqua.
local_pluggables_types
()[source]¶ Accesses all pluggable types :returns: pluggable types :rtype: types
-
qiskit_acqua.
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_acqua.
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_acqua.
register_algorithm
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_algorithm
(name)¶
-
qiskit_acqua.
get_algorithm_class
(name)¶
-
qiskit_acqua.
get_algorithm_instance
(name)¶
-
qiskit_acqua.
get_algorithm_configuration
(name)¶
-
qiskit_acqua.
local_algorithms
()¶
-
qiskit_acqua.
register_optimizer
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_optimizer
(name)¶
-
qiskit_acqua.
get_optimizer_class
(name)¶
-
qiskit_acqua.
get_optimizer_instance
(name)¶
-
qiskit_acqua.
get_optimizer_configuration
(name)¶
-
qiskit_acqua.
local_optimizers
()¶
-
qiskit_acqua.
register_variational_form
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_variational_form
(name)¶
-
qiskit_acqua.
get_variational_form_class
(name)¶
-
qiskit_acqua.
get_variational_form_instance
(name)¶
-
qiskit_acqua.
get_variational_form_configuration
(name)¶
-
qiskit_acqua.
local_variational_forms
()¶
-
qiskit_acqua.
register_initial_state
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_initial_state
(name)¶
-
qiskit_acqua.
get_initial_state_class
(name)¶
-
qiskit_acqua.
get_initial_state_instance
(name)¶
-
qiskit_acqua.
get_initial_state_configuration
(name)¶
-
qiskit_acqua.
local_initial_states
()¶
-
qiskit_acqua.
register_iqft
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_iqft
(name)¶
-
qiskit_acqua.
get_iqft_class
(name)¶
-
qiskit_acqua.
get_iqft_instance
(name)¶
-
qiskit_acqua.
get_iqft_configuration
(name)¶
-
qiskit_acqua.
local_iqfts
()¶
-
qiskit_acqua.
register_oracle
(cls, configuration=None)¶
-
qiskit_acqua.
deregister_oracle
(name)¶
-
qiskit_acqua.
get_oracle_class
(name)¶
-
qiskit_acqua.
get_oracle_instance
(name)¶
-
qiskit_acqua.
get_oracle_configuration
(name)¶
-
qiskit_acqua.
local_oracles
()¶
-
qiskit_acqua.
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_acqua.
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_acqua.
Operator
(paulis=None, grouped_paulis=None, matrix=None, coloring='largest-degree')[source] Bases:
object
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) – The boolean flag for specifying if only basis gates should be used
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.
-
grouped_paulis
Getter of grouped Pauli list.
-
is_empty
()[source] Check Operator is empty or not.
Returns: is empty? Return type: bool
-
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 Note
Do we need to support complex coefficient? If so, what is the format?
-
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.
-
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
-
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:
-


Getting Started with MkDocs
An introductory tutorial!
Installation
To install MkDocs, run the following command from the command line:
pip install mkdocs
For more details, see the Installation Guide.
Creating a new project
Getting started is super easy. To create a new project, run the following command from the command line:
mkdocs new my-project
cd my-project
Take a moment to review the initial project that has been created for you.
There’s a single configuration file named mkdocs.yml
, and a folder named
docs
that will contain your documentation source files (docs
is
the default value for the docs_dir configuration setting). Right now the docs
folder just contains a single documentation page, named index.md
.
MkDocs comes with a built-in dev-server that lets you preview your documentation
as you work on it. Make sure you’re in the same directory as the mkdocs.yml
configuration file, and then start the server by running the mkdocs serve
command:
$ mkdocs serve
INFO - Building documentation...
INFO - Cleaning site directory
[I 160402 15:50:43 server:271] Serving on http://<IP_ADDRESS>:8000
[I 160402 15:50:43 handlers:58] Start watching changes
[I 160402 15:50:43 handlers:60] Start detecting changes
Open up http://<IP_ADDRESS>:8000/
in your browser, and you’ll see the default
home page being displayed:
The dev-server also supports auto-reloading, and will rebuild your documentation whenever anything in the configuration file, documentation directory, or theme directory changes.
Open the docs/index.md
document in your text editor of choice, change the
initial heading to MkLorum
, and save your changes. Your browser will
auto-reload and you should see your updated documentation immediately.
Now try editing the configuration file: mkdocs.yml
. Change the
site_name
setting to MkLorum
and save the file.
site_name: MkLorum
site_url: https://example.com/
Your browser should immediately reload, and you’ll see your new site name take effect.
!!! note
The [`site_name`][site_name] and [`site_url`][site_url] configuration
options are the only two required options in your configuration file. When
you create a new project, the `site_url` option is assigned the placeholder
value: `https://example.com`. If the final location is known, you can change
the setting now to point to it. Or you may choose to leave it alone for now.
Just be sure to edit it before you deploy your site to a production server.
Adding pages
Now add a second page to your documentation:
curl 'https://jaspervdj.be/lorem-markdownum/markdown.txt' > docs/about.md
As our documentation site will include some navigation headers, you may want to
edit the configuration file and add some information about the order, title, and
nesting of each page in the navigation header by adding a nav
setting:
site_name: MkLorum
site_url: https://example.com/
nav:
- Home: index.md
- About: about.md
Save your changes and you’ll now see a navigation bar with Home
and About
items on the left as well as Search
, Previous
, and Next
items on the
right.
Try the menu items and navigate back and forth between pages. Then click on
Search
. A search dialog will appear, allowing you to search for any text on
any page. Notice that the search results include every occurrence of the search
term on the site and links directly to the section of the page in which the
search term appears. You get all of that with no effort or configuration on your
part!
Theming our documentation
Now change the configuration file to alter how the documentation is displayed by
changing the theme. Edit the mkdocs.yml
file and add a theme
setting:
site_name: MkLorum
site_url: https://example.com/
nav:
- Home: index.md
- About: about.md
theme: readthedocs
Save your changes, and you’ll see the ReadTheDocs theme being used.
Changing the Favicon Icon
By default, MkDocs uses the MkDocs favicon icon. To use a different icon, create
an img
subdirectory in the docs
directory and copy your custom favicon.ico
file to that directory. MkDocs will automatically detect and use that file as your
favicon icon.
Building the site
That’s looking good. You’re ready to deploy the first pass of your MkLorum
documentation. First build the documentation:
mkdocs build
This will create a new directory, named site
. Take a look inside the
directory:
$ ls site
about fonts index.html license search.html
css img js mkdocs sitemap.xml
Notice that your source documentation has been output as two HTML files named
index.html
and about/index.html
. You also have various other media that’s
been copied into the site
directory as part of the documentation theme. You
even have a sitemap.xml
file and mkdocs/search_index.json
.
If you’re using source code control such as git
you probably don’t want to
check your documentation builds into the repository. Add a line containing
site/
to your .gitignore
file.
echo "site/" >> .gitignore
If you’re using another source code control tool you’ll want to check its documentation on how to ignore specific directories.
Other Commands and Options
There are various other commands and options available. For a complete list of
commands, use the --help
flag:
mkdocs --help
To view a list of options available on a given command, use the --help
flag
with that command. For example, to get a list of all options available for the
build
command run the following:
mkdocs build --help
Deploying
The documentation site that you just built only uses static files so you’ll be
able to host it from pretty much anywhere. Simply upload the contents of the
entire site
directory to wherever you’re hosting your website from and
you’re done. For specific instructions on a number of common hosts, see the
Deploying your Docs page.
Getting help
See the User Guide for more complete documentation of all of MkDocs’ features.
To get help with MkDocs, please use the GitHub discussions or GitHub issues.


Demonstrates:
Enable Grouping
Remove Grouping
Also try resize , reorder columns or reorder grouped columns.
View Source:
View the source for this example on Github


callback() = fun((term()) -> term())
jobs() = [term()]
result() = [term()]
| run/3 | Runs a callback function on each job at specified concurrency level. |
run(F::callback(), Jobs::jobs(), Max::integer()) -> result()
Runs a callback function on each job at specified concurrency level.
Generated by EDoc


Join our community
30-day hassle-free money back guarantee
Gain access to our full library of tutorials along with expert code
reviews.
Perfect for any developers who are serious about honing their skills.
Monthly Subscription
$29
per month
Full access for less than $1 a day
Sign up


#include <CPUProfiler.h>
Definition at line 22 of file CPUProfiler.h.
Public Types | |
| enum | UsageType { OTHER = 0, GRAPHICS, IO, APPLICATION, IDLE, COUNT } |
Public Member Functions | |
| CPUProfiler () | |
| Creates a new CPU profiler. | |
| void | drawProfile () |
| Renders the profile information on the desktop. | |
| UsageType | getUsageType () |
| Returns the currently set usage type. | |
| void | onFrame () |
| Notifies the profiler about a rendered frame (updates frame count). | |
| void | reset () |
| Resets all profiling information. | |
| void | setUsageType (UsageType usageType) |
| Notifies the profiler about the beginning of a certain type of CPU usage (update usage type times). | |
| ~CPUProfiler () | |
| Destroys the CPU profiler. | |
Protected Member Functions | |
| void | updateSamples () |
| Checks whether the current sample is over and shifts all samples accordingly. | |
Protected Attributes | |
| unsigned long * | averageUsageTime |
| A temporary array of usage times when rendering the CPU profile. | |
| Font * | font |
| The font usage for rendering profile information. | |
| long * | frameCounts |
| An array of samples, each containing the number of frames rendered in that sample. | |
| long | samplesTaken |
| The number of samples taken since the last call to reset(). | |
| unsigned long | sampleStartTime |
| The start time of the current sample. | |
| unsigned long ** | usageTimes |
| An array of samples, each containing an array of CPU usage times, one for each usage type. | |
| UsageType | usageType |
| The currently set usage type. | |
Static Protected Attributes | |
| const int | SAMPLE_COUNT |
| The number of samples to remember. | |
| const int | SAMPLE_LENGTH |
| The number of milliseconds of one samples. | |
| const unsigned long | USAGE_COLORS [UsageType::COUNT] |
| The colors for the usage types when rendering the CPU profile. |
|
|
Definition at line 27 of file CPUProfiler.h. |
|
|
Creates a new CPU profiler.
|
|
|
Destroys the CPU profiler.
|
|
|
Renders the profile information on the desktop.
|
|
|
Returns the currently set usage type.
|
|
|
Notifies the profiler about a rendered frame (updates frame count).
|
|
|
Resets all profiling information.
|
|
|
Notifies the profiler about the beginning of a certain type of CPU usage (update usage type times).
|
|
|
Checks whether the current sample is over and shifts all samples accordingly.
|
|
|
A temporary array of usage times when rendering the CPU profile.
Definition at line 82 of file CPUProfiler.h. |
|
|
The font usage for rendering profile information.
Definition at line 87 of file CPUProfiler.h. |
|
|
An array of samples, each containing the number of frames rendered in that sample.
Definition at line 92 of file CPUProfiler.h. |
|
|
The number of samples to remember. The profiler will take the average of all samples in history when rendering the CPU profile. Definition at line 66 of file CPUProfiler.h. |
|
|
The number of milliseconds of one samples. The profiler will take the average of all samples in history when rendering the CPU profile. Definition at line 72 of file CPUProfiler.h. |
|
|
The number of samples taken since the last call to reset().
Definition at line 97 of file CPUProfiler.h. |
|
|
The start time of the current sample.
Definition at line 102 of file CPUProfiler.h. |
|
|
The colors for the usage types when rendering the CPU profile.
Definition at line 77 of file CPUProfiler.h. |
|
|
An array of samples, each containing an array of CPU usage times, one for each usage type.
Definition at line 107 of file CPUProfiler.h. |
|
|
The currently set usage type.
Definition at line 112 of file CPUProfiler.h. |


Narrated Jabir bin Abdullah:
A person entered the mosque while the Prophet was delivering the Khutba on a Friday. The Prophet said to him, "Have you prayed?" The man replied in the negative. The Prophet said, "Get up and pray two rak`at."
Home Prev Next


Session verification
Checking that the session hasn't changed!
If you see this frame for more than a few seconds something has gone wrong.


class: center, middle # Pandas for Data Analysis
by Titipat Achakulvisut, reference from Python for Data Analysis by Wes McKinney --- ## Essential Python Libraries Recap from last week, here are few libraries that are essentials in Python. - `numpy` multidimensional array, element-wise computation, linear algebra operations - `sciPy` collection of packages addressing a number of different standard problem domains in scientific computing (including sparse matrix computation) - `pandas` data structures, functions designed to make working with structured data fast, easy, and expressive - `matplotlib` producing plots and other 2D data visualizations Today, we're going to focus on `pandas` library --- ## Getting pandas `pandas` comes with Anaconda distribution already. You can also update using `pip` ```bash pip install pandas --upgrade ``` Main pandas data structure is the _DataFrame_ (it's like spread sheet, table). To create dataframe, you can do something like the following: ```python import pandas as pd # convention df = pd.DataFrame([{'a': 2, 'b': 3}, {'a': 1, 'b': 2}]) # from list of dictionary ``` you can also create dataframe from lists of list. ```python df = pd.DataFrame([[2, 3], [1, 2]], columns=['a', 'b']) ``` --- ## Read and write files See [IO Tools](http://pandas.pydata.org/pandas-docs/stable/io.html) for full functionalities. To read data to dataframe, you can use: - `pd.read_csv` - `pd.read_excel` - `pd.read_json` And writing are something like following - `df.to_csv(..., index=False)` - `df.to_excel(...)` - `df.to_json(..., orient='records')`, you can also select format (`split`, `records`, `index`, `columns`, `values`) Or even write multiple sheets ```python writer = pd.ExcelWriter('example_sheets.xlsx') df1.to_excel(writer, 'sheet1') df2.to_excel(writer, 'sheet2') writer.save() ``` --- ## Basic functinalities Describe something quick ```python df.describe() ``` Cast to array/list ```python df.as_matrix() list(df.as_matrix()) ``` Concatenate dataframe ```python df1 = pd.DataFrame([{'a': 2, 'b': 3}, {'a': 1, 'b': 2}]) df2 = pd.DataFrame([{'a': 4, 'b': 6}, {'a': 3.5, 'b': 10}]) df_concat = pd.concat((df1, df2), axis=0) ``` ```python df1 = pd.DataFrame([{'a': 2, 'b': 3}, {'a': 1, 'b': 2}]) df2 = pd.DataFrame([{'c': 4, 'd': 6}, {'c': 3.5, 'd': 10}]) df_concat = pd.concat((df1, df2), axis=1) ``` --- ## Basic functinalities Fill NaN with empty string ```python df.fillna('', inplace=True) ``` Drop duplicated rows ```python df.drop_duplicates(subset='col_name', inplace=True) ``` --- ## Chicago Food Inspection Let's explore Chicago food inspection data from the City of Chicago. Download data [here](https://data.cityofchicago.org/Health-Human-Services/Food-Inspections/4ijn-s7e5/data). Reading data using `csv`: ```python import csv food = list(csv.DictReader(open('Food_Inspections.csv'))) ``` Reading data using `pandas`: ```python import pandas as pd food_df = pd.read_csv('Food_Inspections.csv').fillna('') print(food_df.columns) ``` We'll explore together in class. --- ## Q/A


MATILDA A film review by Steve Rhodes Copyright 1996 Steve Rhodes
RATING (0 TO ****): ***
One of the great novelists of children's books is Roald Dahl. This Spring we got to see an animated movie of his JAMES AND THE GIANT PEACH and loved it. We had a friend who leant us the book, and Jeffrey (age 7) and I spent many a wonderful night this summer reading it. With that in mind, we looked forward to a new movie, MATILDA, based on another of Dahl's books.
MATILDA is a live action film with Danny DeVito as the producer, director, and one of the stars. Between the two recent Dahl movies, it would be hard to pick my favorite. Finally, I should point out that the best movie ever made from a Dahl book has to be 1971's WILLY WONKA AND THE CHOCOLATE FACTORY. I think I have seen that movie at least a half dozen times. I've got to write a review of it someday.
In MATILDA, Matilda Wormwood (Mara Wilson) is born to the worst parents imaginable. On the way out of the hospital, father and fraudulent used car salesman Harry (Danny DeVito) says of the hospital bill, "five thousand dollars! I'm not going to pay it. What are they going to do? Repossess the child?"
Since her father and her mother Zinnia (Rhea Perlman) leave her at home all day from age four on, she becomes independent and an exceptional reader. Having only newspapers and magazines to read, she dares one night to interrupt the family's nightly rendezvous with their beloved television to ask a favor. She asks her father for a book, and astonished, he demands, "A book. Why do you want a book?" She meekly answers, "to read," He sets her straight with, "there's nothing you can get from a book that you can't get from a television faster."
Although the book interchange is extremely funny, I reflected on the fact that libraries are reducing their hours at the same time that the average family spends something like three to four hours a day watching television so people's actions are closer to Harry's than Matilda's.
Her father is the boss. When he gives her orders, he ridicules her with, "I'm smart; you're dumb. I'm big; you're little. And there's nothing you can do about it." Soon she strikes back. She puts super super glue on his hat so it will stick to his head and generally makes his life miserable. Dahl is not your sweetness and light author. His characters have to learn to survive in a hostile world, and they do it with style, imagination, and cunning.
Matilda gets sent to a school run by principal Agatha Trunchbull (Pam Ferris). Trunchbull is a classic villain.  The principal and the parents are all done as near perfect parody. The costumes by Jane Ruhm add immensely to their tacky and overbearing images. The wide-angle camerawork by Cinematographer Stefan Czapsky is effective at accentuating the evil in Matilda's young life.
Too often kid's shows go awry by not casting effective villains. Here Ferris is great as every kid's worst nightmare.  She tells the kids that, "My idea of a perfect school is one in which there are no children." Her school's motto is, "If you are having fun, you are not learning."
If Trunchbull gets angry at kids, she throws them out of the window. In typical Dahl fashion, children so discharged manage to pick flowers for their wonderful and sensitive teacher, Miss Jennifer Honey (Embeth Davidtz).
The star of show is the charming and marvelous child actress Mara Wilson. You may have seen her strength and her screen presence before in 1993's MIRACLE ON 34TH STREET or 1992's MRS. DOUBTFIRE. I hope she makes many more films.
I liked all of the cast. Beside the ones already mentioned, Paul Reubens, a. k. a., Pee Wee Herman, plays an FBI agent trying to bust Harry. I do wish DeVito had not narrated the picture. I found it too jarring having Harry out of character when he was the narrator.
I loved the show from beginning to end. I found myself clapping sometimes and then laughing out loud. It has an infectiously happy ending.
MATILDA runs a fast 1:33. It is rated PG. There are a few situations that might scare kids under 4 or 5, but the language is pretty mild, and there is no sex, nudity, or violence unless you count the cartoonish violence of kids being thrown out the window. Jeffrey loves the show and gives it three thumbs up. I recommend the movie to you and give it ***. I almost gave it a little more.
______________________________________________________________________ **** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: August 20, 1996
Opinions expressed are mine and not meant to reflect my employer's. Date: Wed, 21 Aug 1996 09:03:08 -0700 Organization: Tandem Computers Inc., Cupertino, CA Lines: 100 Message-Id<EMAIL_ADDRESS>Nntp-Posting-Host: clr1-2.mis.tandem.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0b5Gold (Macintosh; I; PPC)
MATILDA A film review by Steve Rhodes Copyright 1996 Steve Rhodes
RATING (0 TO ****): ***
One of the great novelists of children's books is Roald Dahl. This Spring we got to see an animated movie of his JAMES AND THE GIANT PEACH and loved it. We had a friend who leant us the book, and Jeffrey (age 7) and I spent many a wonderful night this summer reading it. With that in mind, we looked forward to a new movie, MATILDA, based on another of Dahl's books.
MATILDA is a live action film with Danny DeVito as the producer, director, and one of the stars. Between the two recent Dahl movies, it would be hard to pick my favorite. Finally, I should point out that the best movie ever made from a Dahl book has to be 1971's WILLY WONKA AND THE CHOCOLATE FACTORY. I think I have seen that movie at least a half dozen times. I've got to write a review of it someday.
In MATILDA, Matilda Wormwood (Mara Wilson) is born to the worst parents imaginable. On the way out of the hospital, father and fraudulent used car salesman Harry (Danny DeVito) says of the hospital bill, "five thousand dollars! I'm not going to pay it. What are they going to do? Repossess the child?"
Since her father and her mother Zinnia (Rhea Perlman) leave her at home all day from age four on, she becomes independent and an exceptional reader. Having only newspapers and magazines to read, she dares one night to interrupt the family's nightly rendezvous with their beloved television to ask a favor. She asks her father for a book, and astonished, he demands, "A book. Why do you want a book?" She meekly answers, "to read," He sets her straight with, "there's nothing you can get from a book that you can't get from a television faster."
Although the book interchange is extremely funny, I reflected on the fact that libraries are reducing their hours at the same time that the average family spends something like three to four hours a day watching television so people's actions are closer to Harry's than Matilda's.
Her father is the boss. When he gives her orders, he ridicules her with, "I'm smart; you're dumb. I'm big; you're little. And there's nothing you can do about it." Soon she strikes back. She puts super super glue on his hat so it will stick to his head and generally makes his life miserable. Dahl is not your sweetness and light author. His characters have to learn to survive in a hostile world, and they do it with style, imagination, and cunning.
Matilda gets sent to a school run by principal Agatha Trunchbull (Pam Ferris). Trunchbull is a classic villain.  The principal and the parents are all done as near perfect parody. The costumes by Jane Ruhm add immensely to their tacky and overbearing images. The wide-angle camerawork by Cinematographer Stefan Czapsky is effective at accentuating the evil in Matilda's young life.
Too often kid's shows go awry by not casting effective villains. Here Ferris is great as every kid's worst nightmare.  She tells the kids that, "My idea of a perfect school is one in which there are no children." Her school's motto is, "If you are having fun, you are not learning."
If Trunchbull gets angry at kids, she throws them out of the window. In typical Dahl fashion, children so discharged manage to pick flowers for their wonderful and sensitive teacher, Miss Jennifer Honey (Embeth Davidtz).
The star of show is the charming and marvelous child actress Mara Wilson. You may have seen her strength and her screen presence before in 1993's MIRACLE ON 34TH STREET or 1992's MRS. DOUBTFIRE. I hope she makes many more films.
I liked all of the cast. Beside the ones already mentioned, Paul Reubens, a. k. a., Pee Wee Herman, plays an FBI agent trying to bust Harry. I do wish DeVito had not narrated the picture. I found it too jarring having Harry out of character when he was the narrator.
I loved the show from beginning to end. I found myself clapping sometimes and then laughing out loud. It has an infectiously happy ending.
MATILDA runs a fast 1:33. It is rated PG. There are a few situations that might scare kids under 4 or 5, but the language is pretty mild, and there is no sex, nudity, or violence unless you count the cartoonish violence of kids being thrown out the window. Jeffrey loves the show and gives it three thumbs up. I recommend the movie to you and give it ***. I almost gave it a little more.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: August 20, 1996
Opinions expressed are mine and not meant to reflect my employer's.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


ngSubmit
ng
Enables binding angular expressions to onsubmit events.
Additionally it prevents the default action (which for form means sending the request to the
server and reloading the current page) but only if the form does not contain an action
attribute.
<form ng-submit="{expression}"> ... </form>
| Param | Type | Details |
|---|---|---|
| ngSubmit | expression | Expression to eval. (Event object is available as |


Bedenbaugh says Evans did good job vs. Rams
Former Sooner Bobby Evans got his big opportunity in the NFL on Sunday night, and he took advantage of it.
Evans started at tackle on the Los Angeles Rams' offensive line against the Chicago Bears, replacing the injured Rob Havenstein.
Oklahoma offensive line coach Bill Bedenbaugh said he didn't get to watch much of the game, but thought Evans did a good job, especially going up against the Bears' defense and guys like linebacker Khalil Mack.
"The little bit I saw, I thought he looked really good," Bedenbaugh said. "I thought he did a heck of a job."
Evans had a breakout performance, helping the Rams beat the Bears 17-7. Los Angeles' offense ran for 110 yards, and quarterback Jared Goff threw for 173 yards.
Fellow Ram and former Oklahoma teammate Ogbonnia Okoronkwo was excited for Evans.
"I was so happy for Bobby. This whole week, me and him talked about this game." Okoronkwo said in an interview posted by the Rams after the game. "He was really excited. He was a little anxious but in a good way. It was just good to see him get out there and do his thing."
Bedenbaugh said Evans and the other recent graduates of Oklahoma's offensive line will be good players when they get their opportunities like Evans got Sunday.
They are all going to be like their former teammate and current Baltimore Ravens' lineman Orlando Brown, Bedenbaugh said.
"The future of those guys is really bright because they are going to continue to develop," Bedenbaugh said.
Sooners' offense got rolling after change on O-line
Oklahoma's offensive line made a change against Baylor on Saturday.
During the first half, R.J. Proctor replaced Erik Swenson at left tackle. A redshirt junior, Swenson has played in every game this season.
Oklahoma coach Lincoln Riley said the switch was planned because the coaches wanted to give Proctor some playing time. After struggling at the start, the line, much like the rest of the offense, began to click in late in the second quarter.
"Eric was fine. We had planned the whole time to play R.J. We thought he’d earned the right to play him some," Riley said. "As R.J. got in there, thought he was playing well and gave him a couple series and then we started to kind of settle a little and got on a roll and so we ended up just leaving him (in)."
A redshirt senior, Proctor came to OU as a graduate transfer from Virginia. He started six games in three seasons at Virginia.
"He stayed extremely positive through playing some and then not playing some and some of the back and forth," Riley said. "He’s worked hard at it and put himself in position to really contribute a lot at the end of the season."
14 Sooners earn conference All-Academic team honors
Fourteen Sooners earned All-Academic Big 12 honors, the conference announced on Tuesday.
Redshirt senior Connor McGinnis and redshirt freshman Devin Staton are two of the seven Big 12 football players with 4.00 GPAs.
To qualify for the All-Academic teams, a player must have a minimum 3.00 GPA and play in at least 20% of the team's contests. The first team consists of players with a GPA of 3.20 or better, and the second team is players with a GPA ranging from 3.00 to 3.19.
Eleven Sooners made the All-Academic Big 12 first team, and three made the second team. Here is the list:
First team Nick Basquine; Pat Fields; Jeremiah Hall; Connor McGinnis; Bryan Mead; Tanner Mordecai; Reeves Mundschau; Devin Staton; Drake Stoops; Jon-Michael Terry; Clayton Woods
Second team Creed Humphrey; Spencer Jones; Trey Sermon
Abby Bitterman, Staff writer


Toggle navigation
Weapon Ads
D3 Charts
(current)
Banana
Facet View
More
Crawler
Indexer
UI source
About
Facetview


Response
class Response
Crafts and sends an http response to the client.
Properties
| protected string | $body | The body of the response to be sent to the client/browser. |
Methods
setResponceCode(int $code)
Sets the http response code.
setBody(string $content, boolean $append = true)
Prepare the body that will be returned to the client.
void
returnResponse()
Returns/echos the body to the client. Should be last thing called.
void
redirect(string $location, integer $responseCode = 302)
Redirect the client to a new location. Must be called before any other content/white space is sent to client.
Details
at line 24
Response
setCookie(string $key, string $value)
Sets a cookie.
at line 36
Response
setHeader(string $header)
Sets a raw header.
at line 48
Response
setResponceCode(int $code)
Sets the http response code.
at line 61
Response
setBody(string $content, boolean $append = true)
Prepare the body that will be returned to the client.
at line 78
void
returnResponse()
Returns/echos the body to the client. Should be last thing called.
at line 90
void
redirect(string $location, integer $responseCode = 302)
Redirect the client to a new location. Must be called before any other content/white space is sent to client.


View Photos of Honda's SEMA Lineup
by Car and DriverEverything from a restored S800 coupe to a vintage Honda-themed Chevy delivery truck will be at the SEMA aftermarket show next week.
Everything from a restored S800 coupe to a vintage Honda-themed Chevy delivery truck will be at the SEMA aftermarket show next week.


Bar meter
If you see this message your web browser doesn't support HTML5. Please download the latest version of
Internet Explorer
,
Mozilla Firefox
(or
Iceweasel
),
Google Chrome
(or
Chromium
) or
Safari
.
Round meter
If you see this message, please update your web browser (it doesn't support HTML5).
Volume meter
If you see this message, please update your web browser (it doesn't support HTML5).
Plot
If you see this message, please update your web browser (it doesn't support HTML5).
Histogram
If you see this message, please update your web browser (it doesn't support HTML5).
Define it in the css as hidden but do not modify directly "width" and "height" attributes in HTML -->


{{ include includes/head.pug }}
My Site
Welcome to my super lame site.
{{ include includes/foot.pug }}


Your score is
This score means You got the right answers in this persentage
If you didn't have a high score don't worry Read this list below to know me more
My name is : Yaser Al-Ananbeh
My age is : 24 years old
My major is : Software Engineering
My favorate color is : Blue
My favorate dish is : molokhia
here I will provide to you the top ten cars in the world
- Bugatti La Voiture Noire
- Pagani Zonda HP Barchetta
- Rolls Royce Sweptails
- Bugatti Centodieci
- Mercedes-Maybach Exelero
- Bugatti Divo
- Pagani Huayra Imola
- Lamborghini Veneno
- McLaren P1 LM
- Lykan HyperSport


<% if @spec.deprecated_in_favor_of %> This library is deprecated, it is recommended you look at <%= @spec.deprecated_in_favor_of %>. <% else %> This library is deprecated. <% end %>


process_co_pc module¶
-
class
process_co_pc.
ProcessCOPC
[source]¶ Bases:
object
Contains the methods to create columns that appear only in the CO and PC files, and not in the PF.
-
copc_epostcard
(df)[source]¶ Generates a piecewise value based on FISYR and EPOSTCARD. This replaces the existing EPOSTCARD value, which is a datetime object, with a 1 or a 0.
ARGUMENTS df (DataFrame) : Core file dataframe
RETURNS Series
-
copc_soiyr
(df)[source]¶ Slices the month off the end of TAXPER. Returns the month-1 if month is not 12. This is a holdover from the original SQL code. Also catches month=1, so that it never returns a month of 0. Identical to STYEAR.
ARGUMENTS df (DataFrame) : Core file dataframe
RETURNS Series
-


---
layout: post
title: Storyboards scene 22 from grand froid
date: '2017-05-31T10:30:17+02:00'
categories:
- Storyboards
- Grand Froid
picture_url: https://film-Storyboards.tumblr.com/post/161280766368/Storyboards-scene-22-from-grand-froid
---
Storyboard, scene 22 from Grand Froid.


A static inner class does not keep an implicit reference to its enclosing instance. This prevents a common cause of memory leaks and uses less memory per instance of the class.
Example:
void sample(){ Thread thread = new Thread(new Runnable() { @Override public void run() { } }); }
The quick-fix extracts anonymous class into a named static inner class:
void sample(){ Thread thread = new Thread(new Task()); } private static class Task implements Runnable { @Override public void run() { } }


{% extends "document_download_template.html" %} {% block per_page_title %}Page not found{% endblock %} {% block main_content %}
If you selected a link in an email, contact the sender to tell them you cannot download your file.
If you typed the web address, check it is correct.
If you pasted the web address, check you copied the entire address.
{% endblock %}


This is a demo app to test the apipie-bindings against. The main purpose is to generate up-to-date apipie.json that the apipie-bindings can consume.


Login to QUALI-T
Login failed!
Sign In
New to QUALI-T?
Sign up now!
Forgot your password?
Reset here!


numerical
Solvers
Call the Differential Evolution solver. |
|
Implementation of dynamic relaxation with RK integration scheme in pure Python. |
|
Implementation of the dynamic relaxation method for form findong and analysis of articulated networks of axial-force members. |
|
Implementation of the force density method to compute equilibrium of axial force networks. |
|
Genetic Algorithm optimisation. |
|
Multi-objective Genetic Algorithm optimisation. |
|
Compute the principle components of a set of data points. |
|
Topology optimisation in 2D using NumPy and SciPy. |
Linalg
Calculates the nullspace of the input matrix A. |
|
Calculates the rank of the input matrix A. |
|
Returns the degrees-of-freedom of the input matrix A. |
|
Identify the pivots of input matrix U. |
|
Identify the non-pivots of input matrix U. |
|
Reduced row-echelon form of matrix A. |
|
Reduced row-echelon form of matrix A. |
|
Reduced row-echelon form of matrix A. |
|
Returns the Cholesky factorisation/decomposition matrix. |
|
Return a function for solving a sparse linear system (LU decomposition). |
|
Calculates the lengths and co-ordinate differences. |
|
Calculates the 2-norm of each row of matrix A. |
|
Normalise the rows of matrix A. |
|
Rotate an array of vectors through 90 degrees around an array of axes. |
|
Solve a system of linear equations with part of solution known. |
|
Solve (sparse) a system of linear equations with part of solution known. |
Matrices
Creates a vertex adjacency matrix. |
|
Creates a matrix representing vertex degrees. |
|
Creates a connectivity matrix from a list of vertex index pairs. |
|
Creates a laplacian matrix from a list of edge topologies. |
|
Creates a face-vertex adjacency matrix. |
|
Creates a network’s nodal mass matrix. |
|
Construct the equilibrium matrix of a structural system. |
Operators
Construct the gradient operator of a trianglular mesh. |
Utilities
Formats float to truncated string. |
|
Changes float precision of float_formatter. |
|
Unchanges float precision of float_formatter back to default. |


QuitCommand: Contents
Quit
Return value
QuitCommand
Quit
Ask the server to silently close the connection.
Return value
None. The connection is closed as soon as the QUIT command is received.


|
Class Summary |
| Button |
Button is a push button control. |
| Check |
Check is a check control. |
| Container |
Container is a control that contains child controls. |
| Control |
Control is the base class for user-interface objects. |
| ControlEvent |
ControlEvent is an event posted by a control. |
| Edit |
Edit is a text entry control. |
| Event |
Event is the base class for all events. |
| KeyEvent |
KeyEvent is a key press event. |
| Label |
Label is a text label control. |
| MainWindow |
MainWindow is the main window of a UI based application. |
| PenEvent |
PenEvent is a pen down, up, move or drag event. |
| Radio |
Radio is a radio control. |
| Tab |
Tab controls appear as tabs in a TabBar control. |
| TabBar |
TabBar is a bar of tabs. |
| Timer |
Timer represents a control's timer. |
| Welcome |
Welcome is the welcome application. |
| Window |
Window is a "floating" top-level window. |


Last week my film group passed around an open ended question: `Daryl Hannah: Wax Figure or Blow Up Doll?' and somehow, being the standard wiseass of me, I wrote `Blow up doll that's been popped once or twice.' The point: a title like American Pop is just asking for it. Bad joke after bad joke can be made at its expense. To team this up with popular music – which brings to mind such thoughts as bubble-gum chewing teenie boppers advocating smacking girls around if you don't look deeper into the almost transparent lyrics – just doesn't strike me as a good idea. Thus it's to Ralph Bakasi's credit that he's able to pull any part of American Pop off.
Further to the film's detriment is the fact that it follows four generations of characters through 80 years of popular music, yet the film still manages to come out massively unscathed and generally feel good… kind of like the people who are now saying Madonna was just a trapped artist back in the 80s who finally got free when she discovered the magic of trance.
Oh well.
 It's serious, it's moderately intelligent, and it has some of the most interesting soundtrack selections (i.e. W.W.II intercut with `Sing, Sing, Sing') that you'll ever hear, but American Pop would neither make its way in the land of live-action or animation if it didn't have such nice music. It has weak characters, cheesy dialogue, and it basically never goes anywhere. It's seemingly triumphant ending really isn't, and it's depressing middle really is.
Yet music-fanatics will be hard-pressed to pass this one up, and nostalgia lovers will get a kick out of this. Everyone else should stick to singing in the shower, and avoid American Pop.

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Important Reminders About Matrix Multiplication
- The number of columns in the left matrix must equal the number of rows in the right matrix.
- The answer matrix always has the same number of rows as the left matrix and the same number of columns as the right matrix.
- Order matters. Multiplying A•B is not the same as multiplying B•A.
- Data in the left matrix should be arranged as rows., while data in the right matrix should be arranged as columns.
If you keep these four points in mind, you should always be able to figure out how to properly arrange your matrix multiplications when building a neural network.


Safe Manager
Home
(current)
About
Login
Sign Up
SignUp
Name
Email
Password
Accept terms and conditions
Submit
Reset


Home
(current)
About
Services
Contact
Capivara.AI
About
EN
Português
English
About
This project is maintained by
capivara-ai
Star


Server Name
DoggyCraft
Server Address
doggycraft.dk
Copy
Server Address
doggycraft.dk
Copy
Discord
Twitch
Vote
YouTube
Minecraft List (dk)
MineList
Minecraft List (org)
Minecraft Servers
Minecraft Server List
Minecraft Server
Minecraft-MP
Top Minecraft Servers


Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
C
D
E
F
G
H
I
J
L
M
N
P
Q
R
S
T
U
V
W
X
Z
E
enableView(int)
- Method in class domosaics.ui.
ViewHandler
enables a view which means that it gets displayed within the mainframe.
equals(DomainFamily)
- Method in class domosaics.model.arrangement.
DomainFamily
Checks if two domain families are equal.
equals(DomainSet)
- Method in class domosaics.model.arrangement.
DomainSet
Compares two sets on equality.
equals(ViewInfo)
- Method in class domosaics.ui.views.view.
ViewInfo
Compares two views based on their unique id.
ExampleDatasetLoader
- Class in
domosaics.ui.io
Class which gives access to example files within the JAR package.
ExampleDatasetLoader()
- Constructor for class domosaics.ui.io.
ExampleDatasetLoader
except(DomainSet)
- Method in class domosaics.model.arrangement.
DomainSet
Returns the Exception between two sets.
expandAll()
- Method in class domosaics.ui.workspace.
WorkspaceView
Because there is no control over the collapsing behavior of the JTree within
WorkspaceTreeModel
this is a helper method to expand the hole tree each time it was changed.
export(View, File, GraphicFormats)
- Method in class domosaics.ui.views.view.export.
DefaultImageExporter
export(View, File, GraphicFormats)
- Method in interface domosaics.ui.views.view.export.
ImageExporter
Exports a view into a given file.
export(View, File, GraphicFormats)
- Method in class domosaics.ui.views.view.export.
PDFImageExporter
export(View, File, GraphicFormats)
- Method in class domosaics.ui.views.view.export.
SVGImageExporter
ExportBySimilarityAction
- Class in
domosaics.ui.views.domainview.actions
ExportBySimilarityAction()
- Constructor for class domosaics.ui.views.domainview.actions.
ExportBySimilarityAction
ExportDomainSequencesAction
- Class in
domosaics.ui.views.domainview.actions
ExportDomainSequencesAction()
- Constructor for class domosaics.ui.views.domainview.actions.
ExportDomainSequencesAction
ExportViewAsImageAction
- Class in
domosaics.ui.views.view.actions
ExportViewAsImageAction exports a view (or the actual focused tool) as image within the format specified by the triggering MenuItems name.
ExportViewAsImageAction()
- Constructor for class domosaics.ui.views.view.actions.
ExportViewAsImageAction
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV LETTER
NEXT LETTER
FRAMES
NO FRAMES
All Classes
A
C
D
E
F
G
H
I
J
L
M
N
P
Q
R
S
T
U
V
W
X
Z


I am a Birmingham-based Computer Science Teacher and amateur musician who loves sharing Computer Science with anyone and everyone!
I am a Computer Science Teacher with experience of teaching at KS2-KS4 levels, with ages ranging from 7 to 16.
I welcome any and all opportunities to talk to and work with other CS teachers so get in touch if you want to bounce ideas around!
I am also currently in the process of trying to become a better guitarist. Check out my progress on my instagram page linked at the bottom of the page.
Alternatively, just click here.
Any suggestions about the page? Want to collaborate on a project? Fancy arguing about who the best Star Trek captain is? (It's Picard btw)
Then feel free to contact me with the email link below!
Contact Me


public final class MoreLikeThis extends Object
Lucene does let you access the document frequency of terms, with IndexReader.docFreq().
Term frequencies can be computed by re-tokenizing the text, which, for a single document,
is usually fast enough. But looking up the docFreq() of every term in the document is
probably too slow.
You can use some heuristics to prune the set of terms, to avoid calling docFreq() too much,
or at all. Since you're trying to maximize a tf*idf score, you're probably most interested
in terms with a high tf. Choosing a tf threshold even as low as two or three will radically
reduce the number of terms under consideration. Another heuristic is that terms with a
high idf (i.e., a low df) tend to be longer. So you could threshold the terms by the
number of characters, not selecting anything less than, e.g., six or seven characters.
With these sorts of heuristics you can usually find small set of, e.g., ten or fewer terms
that do a pretty good job of characterizing a document.
It all depends on what you're trying to do. If you're trying to eek out that last percent
of precision and recall regardless of computational difficulty so that you can win a TREC
competition, then the techniques I mention above are useless. But if you're trying to
provide a "more like this" button on a search results page that does a decent job and has
good performance, such techniques might be useful.
An efficient, effective "more-like-this" query generator would be a great contribution, if
anyone's interested. I'd imagine that it would take a Reader or a String (the document's
text), analyzer Analyzer, and return a set of representative terms using heuristics like those
above. The frequency and length thresholds could be parameters, etc.
Doug
This class has lots of options to try to make it efficient and flexible. The simplest possible usage is as follows. The bold fragment is specific to this class.
IndexReader ir = ... IndexSearcher is = ... MoreLikeThis mlt = new MoreLikeThis(ir); Reader target = ... // orig source of doc you want to find similarities to Query query = mlt.like( target); Hits hits = is.search(query); // now the usual iteration thru 'hits' - the only thing to watch for is to make sure //you ignore the doc if it matches your 'target' document, as it should be similar to itselfThus you:
setFieldNames(...)
so you can
examine multiple fields (e.g. body and title) for similarity.
Depending on the size of your index and the size and makeup of your documents you may want to call the other set methods to control how the similarity queries are generated:
setMinTermFreq(...)
setMinDocFreq(...)
setMaxDocFreq(...)
setMaxDocFreqPct(...)
setMinWordLen(...)
setMaxWordLen(...)
setMaxQueryTerms(...)
setMaxNumTokensParsed(...)
setStopWord(...)
Changes: Mark Harwood 29/02/04 Some bugfixing, some refactoring, some optimisation. - bugfix: retrieveTerms(int docNum) was not working for indexes without a termvector -added missing code - bugfix: No significant terms being created for fields with a termvector - because was only counting one occurrence per term/field pair in calculations(ie not including frequency info from TermVector) - refactor: moved common code into isNoiseWord() - optimise: when no termvector support available - used maxNumTermsParsed to limit amount of tokenization
| Modifier and Type | Field and Description |
|---|---|
static
Analyzer
|
DEFAULT_ANALYZER
Deprecated.
This default will be removed in Lucene 4.0 (with the default
being null). If you are not using term vectors, explicitly set
your analyzer instead.
|
static boolean
|
DEFAULT_BOOST
Boost terms in query based on score.
|
static
String
[]
|
DEFAULT_FIELD_NAMES
Default field names.
|
static int
|
DEFAULT_MAX_DOC_FREQ
Ignore words which occur in more than this many docs.
|
static int
|
DEFAULT_MAX_NUM_TOKENS_PARSED
Default maximum number of tokens to parse in each example doc field that is
not stored with TermVector support.
|
static int
|
DEFAULT_MAX_QUERY_TERMS
Return a Query with no more than this many terms.
|
static int
|
DEFAULT_MAX_WORD_LENGTH
Ignore words greater than this length or if 0 then this has no effect.
|
static int
|
DEFAULT_MIN_DOC_FREQ
Ignore words which do not occur in at least this many docs.
|
static int
|
DEFAULT_MIN_TERM_FREQ
Ignore terms with less than this frequency in the source doc.
|
static int
|
DEFAULT_MIN_WORD_LENGTH
Ignore words less than this length or if 0 then this has no effect.
|
static
Set
>
|
DEFAULT_STOP_WORDS
Default set of stopwords.
|
| Constructor and Description |
|---|
MoreLikeThis
(
IndexReader
ir)
Constructor requiring an IndexReader.
|
MoreLikeThis
(
IndexReader
ir,
Similarity
sim)
|
| Modifier and Type | Method and Description |
|---|---|
String
|
describeParams
()
Describe the parameters that control how the "more like this" query is
formed.
|
Analyzer
|
getAnalyzer
()
Returns an analyzer that will be used to parse source doc with.
|
float
|
getBoostFactor
()
Returns the boost factor used when boosting terms
|
String
[]
|
getFieldNames
()
Returns the field names that will be used when generating the 'More Like
This' query.
|
int
|
getMaxDocFreq
()
Returns the maximum frequency in which words may still appear.
|
int
|
getMaxNumTokensParsed
()
|
int
|
getMaxQueryTerms
()
Returns the maximum number of query terms that will be included in any
generated query.
|
int
|
getMaxWordLen
()
Returns the maximum word length above which words will be ignored.
|
int
|
getMinDocFreq
()
Returns the frequency at which words will be ignored which do not occur in
at least this many docs.
|
int
|
getMinTermFreq
()
Returns the frequency below which terms will be ignored in the source doc.
|
int
|
getMinWordLen
()
Returns the minimum word length below which words will be ignored.
|
Similarity
|
getSimilarity
()
|
Set
>
|
getStopWords
()
Get the current stop words being used.
|
boolean
|
isBoost
()
Returns whether to boost terms in query based on "score" or not.
|
Query
|
like
(
File
f)
Deprecated.
use
like(Reader, String)
instead
|
Query
|
like
(
InputStream
is)
Deprecated.
use
like(Reader, String)
instead
|
Query
|
like
(int docNum)
Return a query that will return docs like the passed lucene document ID.
|
Query
|
like
(
Reader
r)
Deprecated.
use
like(Reader, String)
instead
|
Query
|
like
(
Reader
r,
String
fieldName)
Return a query that will return docs like the passed Reader.
|
Query
|
like
(
URL
u)
Deprecated.
use
like(Reader, String)
instead
|
String
[]
|
retrieveInterestingTerms
(int docNum)
|
String
[]
|
retrieveInterestingTerms
(
Reader
r)
Deprecated.
use
retrieveInterestingTerms(Reader, String)
instead.
|
String
[]
|
retrieveInterestingTerms
(
Reader
r,
String
fieldName)
Convenience routine to make it easy to return the most interesting words in a document.
|
PriorityQueue
<
Object
[]>
|
retrieveTerms
(int docNum)
Find words for a more-like-this query former.
|
PriorityQueue
<
Object
[]>
|
retrieveTerms
(
Reader
r)
Deprecated.
use
retrieveTerms(Reader, String)
instead
|
PriorityQueue
<
Object
[]>
|
retrieveTerms
(
Reader
r,
String
fieldName)
Find words for a more-like-this query former.
|
void
|
setAnalyzer
(
Analyzer
analyzer)
Sets the analyzer to use.
|
void
|
setBoost
(boolean boost)
Sets whether to boost terms in query based on "score" or not.
|
void
|
setBoostFactor
(float boostFactor)
Sets the boost factor to use when boosting terms
|
void
|
setFieldNames
(
String
[] fieldNames)
Sets the field names that will be used when generating the 'More Like This'
query.
|
void
|
setMaxDocFreq
(int maxFreq)
Set the maximum frequency in which words may still appear.
|
void
|
setMaxDocFreqPct
(int maxPercentage)
Set the maximum percentage in which words may still appear.
|
void
|
setMaxNumTokensParsed
(int i)
|
void
|
setMaxQueryTerms
(int maxQueryTerms)
Sets the maximum number of query terms that will be included in any
generated query.
|
void
|
setMaxWordLen
(int maxWordLen)
Sets the maximum word length above which words will be ignored.
|
void
|
setMinDocFreq
(int minDocFreq)
Sets the frequency at which words will be ignored which do not occur in at
least this many docs.
|
void
|
setMinTermFreq
(int minTermFreq)
Sets the frequency below which terms will be ignored in the source doc.
|
void
|
setMinWordLen
(int minWordLen)
Sets the minimum word length below which words will be ignored.
|
void
|
setSimilarity
(
Similarity
similarity)
|
void
|
setStopWords
(
Set
> stopWords)
Set the set of stopwords.
|
public static final int DEFAULT_MAX_NUM_TOKENS_PARSED
getMaxNumTokensParsed()
,
Constant Field Values
@Deprecated public static final Analyzer DEFAULT_ANALYZER
getAnalyzer()
public static final int DEFAULT_MIN_TERM_FREQ
getMinTermFreq()
,
setMinTermFreq(int)
,
Constant Field Values
public static final int DEFAULT_MIN_DOC_FREQ
getMinDocFreq()
,
setMinDocFreq(int)
,
Constant Field Values
public static final int DEFAULT_MAX_DOC_FREQ
getMaxDocFreq()
,
setMaxDocFreq(int)
,
setMaxDocFreqPct(int)
,
Constant Field Values
public static final boolean DEFAULT_BOOST
isBoost()
,
setBoost(boolean)
,
Constant Field Values
public static final String [] DEFAULT_FIELD_NAMES
public static final int DEFAULT_MIN_WORD_LENGTH
getMinWordLen()
,
setMinWordLen(int)
,
Constant Field Values
public static final int DEFAULT_MAX_WORD_LENGTH
getMaxWordLen()
,
setMaxWordLen(int)
,
Constant Field Values
public static final Set > DEFAULT_STOP_WORDS
setStopWords(java.util.Set>)
,
getStopWords()
public static final int DEFAULT_MAX_QUERY_TERMS
public MoreLikeThis( IndexReader ir)
public MoreLikeThis( IndexReader ir, Similarity sim)
public float getBoostFactor()
public void setBoostFactor(float boostFactor)
boostFactor
-
public Similarity getSimilarity()
public void setSimilarity( Similarity similarity)
public Analyzer getAnalyzer()
DEFAULT_ANALYZER
.
DEFAULT_ANALYZER
public void setAnalyzer( Analyzer analyzer)
like(int)
method, all other 'like' methods require
an analyzer.
analyzer
- the analyzer to use to tokenize text.
public int getMinTermFreq()
DEFAULT_MIN_TERM_FREQ
.
public void setMinTermFreq(int minTermFreq)
minTermFreq
- the frequency below which terms will be ignored in the source doc.
public int getMinDocFreq()
DEFAULT_MIN_DOC_FREQ
.
public void setMinDocFreq(int minDocFreq)
minDocFreq
- the frequency at which words will be ignored which do not occur in
at least this many docs.
public int getMaxDocFreq()
DEFAULT_MAX_DOC_FREQ
.
public void setMaxDocFreq(int maxFreq)
maxFreq
- the maximum count of documents that a term may appear in to be
still considered relevant
public void setMaxDocFreqPct(int maxPercentage)
maxPercentage
- the maximum percentage of documents (0-100) that a term may appear
in to be still considered relevant
public boolean isBoost()
DEFAULT_BOOST
.
setBoost(boolean)
public void setBoost(boolean boost)
boost
- true to boost terms in query based on "score", false otherwise.
isBoost()
public String [] getFieldNames()
DEFAULT_FIELD_NAMES
.
public void setFieldNames( String [] fieldNames)
fieldNames
- the field names that will be used when generating the 'More Like
This' query.
public int getMinWordLen()
DEFAULT_MIN_WORD_LENGTH
.
public void setMinWordLen(int minWordLen)
minWordLen
- the minimum word length below which words will be ignored.
public int getMaxWordLen()
DEFAULT_MAX_WORD_LENGTH
.
public void setMaxWordLen(int maxWordLen)
maxWordLen
- the maximum word length above which words will be ignored.
public void setStopWords( Set > stopWords)
stopWords
- set of stopwords, if null it means to allow stop words
StopFilter.makeStopSet()
,
getStopWords()
public Set > getStopWords()
setStopWords(java.util.Set>)
public int getMaxQueryTerms()
DEFAULT_MAX_QUERY_TERMS
.
public void setMaxQueryTerms(int maxQueryTerms)
maxQueryTerms
- the maximum number of query terms that will be included in any
generated query.
public int getMaxNumTokensParsed()
DEFAULT_MAX_NUM_TOKENS_PARSED
public void setMaxNumTokensParsed(int i)
i
- The maximum number of tokens to parse in each example doc field
that is not stored with TermVector support
public Query like(int docNum) throws IOException
docNum
- the documentID of the lucene doc to generate the 'More Like This"
query for.
IOException
@Deprecated public Query like( File f) throws IOException
like(Reader, String)
instead
IOException
@Deprecated public Query like( URL u) throws IOException
like(Reader, String)
instead
IOException
@Deprecated public Query like( InputStream is) throws IOException
like(Reader, String)
instead
IOException
@Deprecated public Query like( Reader r) throws IOException
like(Reader, String)
instead
IOException
public Query like( Reader r, String fieldName) throws IOException
IOException
public String describeParams()
public PriorityQueue < Object []> retrieveTerms(int docNum) throws IOException
docNum
- the id of the lucene document from which to find terms
IOException
public PriorityQueue < Object []> retrieveTerms( Reader r, String fieldName) throws IOException
retrieveInterestingTerms()
.
r
- the reader that has the content of the document
fieldName
- field passed to the analyzer to use when analyzing the content
IOException
retrieveInterestingTerms(int)
@Deprecated public PriorityQueue < Object []> retrieveTerms( Reader r) throws IOException
retrieveTerms(Reader, String)
instead
IOException
public String [] retrieveInterestingTerms(int docNum) throws IOException
IOException
retrieveInterestingTerms(java.io.Reader, String)
public String [] retrieveInterestingTerms( Reader r, String fieldName) throws IOException
retrieveTerms()
directly.
r
- the source document
fieldName
- field passed to analyzer to use when analyzing the content
IOException
retrieveTerms(java.io.Reader, String)
,
setMaxQueryTerms(int)
@Deprecated public String [] retrieveInterestingTerms( Reader r) throws IOException
retrieveInterestingTerms(Reader, String)
instead.
IOException


All in one media consumption.
Set up a Raspberry Pi as torrent downloader and media server.
I did this using a Raspberry Pi 2 model B but could be done with any Linux box, I don't think any of these steps are Debian specific. These steps will also work on the original Raspberry Pi's but performance might be an issue.
Get your Raspberry Pi set up with Rasbian and update it. You'll also want to get a static IP set up, either on the Raspberry Pi or a lot of routers let you set a device to keep its IP.
The torrent server we'll be running is called Transmission. As well as a graphical interface there is a version which runs as a service and can be controlled via command line or a web interface. We'll be using the later. Install it by running:
We'll need to make some changes to its config file, but transmission is a bit strange. It writes its config file on exiting so any edits made it is running will be lost. First, stop the daemon if it started on install then edit the config file:
You'll want to edit a few lines to enable the incomplete directory and allow connection to the web interface:
I also like to disable password authentication on the web interface:
Then start the daemon again:
This isn't exactly the most secure set up. You can see the full list of options on the Transmission Wiki. Just remember, transmission must be stopped while you're editing the file.
Right, that should be transmission up and running. You should be able to access the web interface by pointing your web browser at http://< ip address >:9091. Add a few torrents and they should download to the incomplete folder then move to the download folder once they're finished. This is important for the DLNA server. Feel free to change these paths if you want it to download to external storage.
Actually called ReadyMedia but the package is still called minidlna. We'll also need inotify for automatically detecting new files. Install them:
Next edit a few lines in its config file (/etc/minidlna.conf):
The friendly name shows up when you're browing for media servers. To restart the servive and rebuild the media database (you'll need to do this if you add or change media locations) run:
That should be you all done.
It's true that you can torrent more than just videos and minidlna supports audio and image folders too. The only issue being each folder should have one type of media in it. Transmission supports running scripts on finishing a download so you could write a simple script to check the file type downloaded and move it to the matching folder, say /opt/media/video, /opt/media/music. Then have those folders set up in minidlna.conf. You wouldn't need the incomplete folder this way either.


Header
Flash-Message
Link
Topic
Topic
by John Doe, created 01.01.2000 12:00:00
Category Name
Text of the reply.
New Reply
Reply content
Button-Title
Footer
Bottom-Scripts


"
For all the ice-cream addicts out there, this is the place for you to learn evrything there is to know about it and to add your own unique recipes, combinations, and flavors!
Find Out MoreTHEY SAY REVENGE IS A DISH BEST SERVED COLD.

SO BASICALLY REVENGE IS ICE CREAM.
A cold dessert similar to ice cream, but made with eggs in addition to cream and sugar.
Italian ice cream
A frozen dessert made with yogurt and sometimes other dairy products.
Fruit-flavored ice
Give us feedback! Give us a call or send us an email and we will get back to you as soon as possible!
123-456-6789