Plugin Information |
|---|
View Rundeck on the plugin site for more information. |
Older versions of this plugin may not be safe to use. Please review the following warnings before using an older version:
This plugin is a Notifier that will talk to a RunDeck instance (via its HTTP API) to schedule a job execution on RunDeck after a successful build on Jenkins.
It is also a Trigger that will schedule a build on Jenkins after a job execution on RunDeck (using RunDeck WebHook Notification).
In addition, it turns Jenkins into an Option provider for RunDeck, if you want to use your Jenkins build artifacts as an option to a RunDeck job.
Table of Contents
Use
RunDeck is an open-source tool for automating tasks on multiple nodes, with both a CLI and a web-based interface. You can use it to deploy your application to multiple nodes/appserv easily. It has a concept of jobs and build similar to Jenkins.
You have 3 ways to use this plugin :
- build a "deployment pipeline", (the "0-click deployment process") : you commit a change, Jenkins picks it up, build, test and so on, and then triggers a job execution on RunDeck for deploying your application. This requires some configuration on Jenkins (both global configuration and job configuration), to link a Jenkins job with a RunDeck job.
- continue your pipeline after the deployment : RunDeck deploys your application, then triggers a build on Jenkins to run some integration tests (Selenium ?). This requires some configuration on RunDeck (WebHook notification) and on Jenkins (Trigger configuration, and optionally filter the notifications from RunDeck).
- use Jenkins as an Option provider for RunDeck : when you execute a RunDeck job, you can have an (input) option, whose values could be retrieve from an external system (here, Jenkins). So you can have a RunDeck-job that use a Jenkins-artifact (from a Jenkins-build) as an input.
Note that you can combine those use-cases.
Deployment Pipeline
The goal is to have a 0-click deployment process : you commit a change, Jenkins picks it up, build, test and so on, and then triggers a job execution on RunDeck for deploying your application.
You can also have an "on-demand" process : configure a "tag" in the job configuration (see below), and the plugin will only notify RunDeck if the tag is present in the SCM changelog (= in the commit message).
Configuration
First, you need to configure your RunDeck instance on the main Jenkins configuration page :
As of Rundeck plugin version 3.0, you can specify an Authtoken instead of Login/Password. Additionally you can set the API version if you need to use a lower number than the latest version.
You can use the "Test Connection" button to make sure that Jenkins can talk to your RunDeck instance :
|
|
Error message in case of error |
Success message when your credentials are valid |
Then, for each Jenkins job, configure the target RunDeck job that should be executed, along with its options :
|
|
The per-job configuration screen |
If you click "Check Job" it will display the job details (group, job name and project) |
- Note that the "options" should be expressed in the java-properties format, and that Jenkins environment variables are expanded when making the RunDeck API calls (for more details, read the integrated-help in your Jenkins instance by clicking the "?" icon next to the "options" field).
- The "tag" field is used to perform "on-demand" job scheduling on RunDeck : if the value is not empty, we will check if the SCM changelog (= the commit message) contains the given tag, and only schedule a job execution if it is present. For example you can set the value to "#deploy". Note that if this value is left empty, we will ALWAYS schedule a job execution.
- You can choose to wait for the RunDeck job to finish before finishing the Jenkins build. Otherwise, the default behavior is to trigger a RunDeck job, and finish the Jenkins build (usually before the RunDeck job has ended).
- If the last checkbox is checked, then a failure to schedule the job execution on RunDeck will fail the Jenkins build. Otherwise, the RunDeck integration won't interact with the result of your Jenkins build (even if RunDeck is down).
Post-deployment job
The goal is to continue the deployment pipeline after a successful deployment : RunDeck deploys your application, and triggers a build on Jenkins to run some integration tests (using Selenium for example).
Configuration
First, you need to configure the WebHook Notification in your RunDeck jobs. Set it to the url http://JENKINS_HOST/plugin/rundeck/webhook/.
Then, configure the "RunDeck Trigger" on your Jenkins jobs : activate it, and optionally filter the notifications from RunDeck.
Use
If your Jenkins job is started by a RunDeck notification, you can access the data of the RunDeck notification as environment variables :
- RDECK_JOB_ID : the ID (UUID) of the job
- RDECK_JOB_NAME : the name of the job
- RDECK_JOB_GROUP : the group of the job
- RDECK_JOB_DESCRIPTION : the description of the job
- RDECK_PROJECT : the name of the project
- RDECK_EXEC_ID : the ID of the execution
- RDECK_EXEC_STATUS : the status of the execution (one of SUCCEEDED, FAILED or ABORTED)
- RDECK_EXEC_STARTED_BY : the user who started the execution
- RDECK_EXEC_STARTED_AT : the date at which the execution started
- RDECK_EXEC_ENDED_AT : the date at which the execution ended
- RDECK_EXEC_ABORTED_BY : the user who aborted the execution (if the status is ABORTED)
- RDECK_EXEC_DURATION_MILLIS : the duration of the execution, in milli-seconds
- RDECK_EXEC_DURATION_SECONDS : the duration of the execution, in seconds
- RDECK_EXEC_DURATION : the duration of the execution, as a human-readable string ("3 minutes 34 seconds")
- RDECK_EXEC_SHORT_DURATION : the duration of the execution, as a short human-readable string ("0:03:34.187")
- RDECK_EXEC_URL : the url of the execution (on the RunDeck Web GUI)
- RDECK_EXEC_DESCRIPTION : the description of the execution
- RDECK_EXEC_ARG_[NAME] : the value of a Job option passed to the execution (plugin version 3.0 or later)
Option Provider
Using Jenkins as an Option provider for RunDeck is very easy, because you don't need to configure anything on the Jenkins side. You just need to point your RunDeck option "remote url" to one of the following url :
Option Provider for artifacts
List all artifacts for a given project / build, with a reference to the absolute url of the artifact. Useful if you have multiple artifacts to deploy (one per architecture for example).
Example (RunDeck screen when executing a job with an "artifact" option, taking its values from Jenkins) :
The url : http://JENKINS_HOST/plugin/rundeck/options/artifact
- The parameter project is mandatory (name of the job)
- The parameter build is optional (default value is 'last'). It could be either a build number, or "last", "lastStable" or "lastSuccessful".
- The parameter artifactRegex is optional. It is a java-regex used to filter the artifacts to return (if empty, all artifacts will be returned).
Example : http://JENKINS_HOST/plugin/rundeck/options/artifact?project=my-job&build=lastSuccessful&artifactRegex=.*\.war
Option Provider for builds
List all builds (versions) for a given project / artifact, with a reference to the absolute url of the artifact. Useful if you have only 1 main artifact, but want to easily re-deploy an older version of the artifact.
Example (RunDeck screen when executing a job with a "build" option, taking its values from Jenkins) :
The url : http://JENKINS_HOST/plugin/rundeck/options/build
- The parameter project is mandatory (name of the job)
- Either the parameter artifact (exact filename of the artifact) or artifactRegex (java-regex matching the filename of the artifact) is mandatory
- The parameter limit is optional. It should be an integer, and is used to limit the number of builds (versions) to return.
- The parameters includeLastStableBuild, includeLastSuccessfulBuild and includeLastBuild are optional booleans. If it is equals to "true", then we will add an entry for the last / last stable / last successful build.
Option Provider Access
Note: Rundeck will call the url anonymously which means the Jenkins job should provide access to Discover and Read the job. See Matrix based security documentation: https://wiki.jenkins-ci.org/display/JENKINS/Matrix-based+security#Matrix-basedsecurity-Job
Compatibility Matrix
This plugin is not compatible with all versions of RunDeck
Plugin version |
RunDeck 1.0 / 1.1 |
RunDeck 1.2+ |
|---|---|---|
1.x |
|
|
2.x |
|
|
3.x |
|
|
If you are using Plugin version 3.x and need to access an older Rundeck server, you can set the API version in the plugin settings.
You can find older versions of the plugin here : http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/rundeck/
FAQ
Known Issues
- If you have invalid links to RunDeck executions, check your RunDeck configuration : fix the property "grails.serverURL" in the file $RDECK_HOME/server/config/rundeck-config.properties.
- With the versions 1.x of the plugin, you can't have RunDeck jobs with the same groupPath/jobName on multiple projects.
- Remote options getting 400 server error from Jenkins probably mean you need to grant anonymous access to Discover and Read the Jenkins project
Links
- Sources on github : https://github.com/jenkinsci/rundeck-plugin
- Download binaries (.hpi files) on nexus : http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/rundeck/
Change Log
Version 3.6.1 (Jan 26, 2017)
- JENKINS-34510 Improve Jenkins startup time and Rundeck jobs generation with job-dsl thanks to caching (please note: it has to be enabled explicitly in the global config)
- JENKINS-31423 Allow build parameters or references to environment variables in 'Job Identifier' field
- Add Jenkins Pipelines support to Option Provider
- Update RunDeck API Java client library to 13.1
TODO list
- Internationalization
- Option provider : add integration with the Promoted Builds Plugin and/or Promoted Builds Simple Plugin so that we can filter only "promoted" builds.
- Use a drop-down field to select the RunDeck job (list of jobs retrieved using the API) instead of the basic text field
Previous versions
Version 3.6.0 - skipped
Version 3.5.4 (May 19, 2016)
- New: JENKINS-22851 Support multiple Rundeck installations: Configure multiple Rundeck instances (in the global config), and choose the instance to use in the job configuration
- New: JENKINS-31150 Support Multiple SCM tags for rundeck notifier
- Fixed: JENKINS-28697 Aborted job is marked as SUCCESS if "Wait for Rundeck" is used
Version 3.5 (Oct 20, 2015)
- Use display name for the build name
- Set the build result to failure when rundeck fails AND shouldFailTheBuild is set to true. Previously only "marked" the failure; by changing the status of the build to FAIL, other plugins that might be called after rundeck will then be able to detect the status, and handle accordingly.
- Fixed bug where log tailer returned completed even though the job was still running (output was completed). Now both execCompleted and completed are validated
- Filtered out RundeckOutputEntries with empty messages
- No longer depend on last mod for sleep timing since behaviour seems to be not aligned with expectations. Now checking if offset has changed.
- Fixed bug where checkbox wasn't visible in Jenkins
- [JENKINS-28059] Validate API version in test connection
Version 3.4 (Apr 16, 2015)
- Added support to include Rundeck logs in the Jenkins build log
- Support jobs inside folders
- Fix for Exception when using $ARTIFACT_NAME
- Fixed: Badge icons fail is jenkins is not root as "/"
- Changed "RunDeck" text items to the correct "Rundeck"
- Updated the Rundeck client to v12.0 [Fixes JENKINS-27971 — NPE with Rundeck v2.4.2]
Version 3.2 (April 15, 2014)
- Fixed issue with parsing Job options when option values have hyphens
Version 3.1 (March 29, 2014)
- Build the URL using the getRootUrl method, which will use the user configured root url
Version 3.0 (January 28, 2014)
- Update rundeck API client lib to latest (9.3)
- Support Token authentication
- Fix authentication against Rundeck running as a war in Tomcat
- Support RDECK_EXEC_ARG_[NAME] in triggers from Rundeck webhook notifications
- Update naming ("RunDeck" changed to "Rundeck"), update icon
Version 2.11 (January 4, 2012)
- Fix JENKINS-12228 : allow to filter artifacts returned by the option provider, based on a java-regex
Version 2.10 (October 12, 2011)
- Fix icon path URL - Thanks to Joe Passavanti for the patch !
- Small UI fix : don't display job's ID (in rundeck 1.3+, ID is an UUID, and it breaks the UI because it is too long)
Version 2.9 (September 18, 2011)
- Allow to filter nodes when triggering a rundeck job (using the "nodeFilters" parameter)
Version 2.8 (September 16, 2011)
- Configure RunDeck jobs with either a job ID, or an UUID (rundeck 1.3+), or a "reference". A job reference is expressed in the format "project:group/job", for example : "my-project-name:main-group/sub-group/my-job-name", or "my-project-name:my-job-name" (for a job without a group).
Version 2.7 (September 14, 2011)
- Add a build trigger, using RunDeck 1.3 WebHook Notification, so that you can run integration tests with Jenkins after a RunDeck deployment (alternative to the "Wait for RunDeck job to finish ?" checkbox in the notifier configuration and a post-build action to schedule another job)
- Upgrade RunDeck API Java client to version 1.2
Version 2.6 (September 2, 2011)
- Add token expansion for $ARTIFACT_NAME{regex} in options (see http://groups.google.com/group/rundeck-discuss/browse_thread/thread/94a6833b84fdc10b)
Version 2.5 (July 11, 2011)
- Internal refactoring : use the RunDeck API Java client
- Never display the RunDeck password in logs (even in case of error)
Version 2.4 (June 28, 2011)
- Change Job ID support to use Strings instead of Long, allowing UUIDs (coming in RunDeck 1.3) - Thanks to Greg Schueler for the patch !
Version 2.3.1 (June 22, 2011)
- Fix a bug introduced in version 2.3 : NPE related to the new field (shouldWaitForRundeckJob) in already configured jobs. Workaround is to re-save job configuration or use version 2.3.1
Version 2.3 (June 21, 2011)
- Add an option to wait for the RunDeck job to finish (by polling the execution every 5 seconds via the RunDeck API)
- Add a validation button on the job configuration screen, to check the RunDeck job (display job name, group and project)
Version 2.2 (June 17, 2011)
- Add SSL support for RunDeck REST API (trust all certificates and hosts)
Version 2.1 (June 8, 2011)
- New feature : display information about the RunDeck job on the page of a Jenkins job (with a direct link to the RunDeck job details webpage)
Version 2.0.1 (June 8, 2011)
- Rerelease 2.0 and mark it as incompatible with versions 1.x (jobs configuration needs to be updated), so that users can see it in the update-center before updating.
Version 2.0 (June 6, 2011)
Compatibility Warning !
This version won't work with RunDeck 1.0/1.1, and the configuration per job has changed, you will need to update the configuration for all your jobs that use this plugin !
- Use the new RunDeck 1.2+ HTTP REST API, and thus is incompatible with RunDeck 1.0 or RunDeck 1.1
- Use "jobId" to reference RunDeck jobs, instead of the "groupPath/jobName" couple, so you'll need to reconfigure your Jenkins jobs. We switched to the "jobId" reference because it is unique across all projects in a RunDeck instance, which is not the case for the "groupPath/jobName" couple.
- Set required Jenkins version to 1.400
Version 1.8 (June 5, 2011)
- Fix JENKINS-9876 : password field in system configuration should be hidden.
Version 1.7 (June 1, 2011)
- New improvement to the option provider : you can now match artifacts with a java-regex in addition to exact-match of the artifact filename (see the new 'artifactRegex' parameter).
Version 1.6 (April 6, 2011)
- Fix a bug with RunDeck 1.2 : scheduling a job with options did not work on RunDeck 1.2.
- Set required Jenkins version to 1.399 (See the thread on the jenkinsci-dev mailing-list).
Version 1.5.1 (March 24, 2011)
- Rerelease 1.5 to properly set required Jenkins version (See the thread on the jenkinsci-dev mailing-list) : the plugin now depends on Jenkins 1.398 (or higher).
Version 1.5 (March 4, 2011)
- Fix bug : when using a "tag" to auto-deploy, we should also check the SCM changelog from upstream builds. So that you can commit to an upstream job, and have all downstream jobs redeployed.
Version 1.4 (March 1, 2011)
- New improvement to the option provider : in addition to the list of artifacts for a given build, you can now get the list of builds (versions) for a given artifact.
Version 1.3 (February 27, 2011)
- Jenkins can now be used as an "Option provider" for RunDeck, if you want to use your Jenkins build artifacts as an option to a RunDeck job.
Version 1.2 (February 27, 2011)
- Jenkins environment variables specified in the "options" are now correctly expanded (GitHub issue)
Version 1.1 (February 11, 2011)
- Do nothing if the build is failing
- Add a link to the RunDeck job execution page (on each Jenkins successful build)
- Validation on the form fields (test if RunDeck is alive, test credentials, etc)
Version 1.0 (February 10, 2011)
- Initial release
- Compatible (and tested) with Jenkins 1.396 and RunDeck 1.1
Attachments:
jenkins-config.png (image/png)
logo-rundeck.png (image/png)
logo-rundeck.png (image/png)
job-config.png (image/png)
option-provider-build.png (image/png)
option-provider-artifact.png (image/png)
jenkins-config.png (image/png)
jenkins-config-validation-nok.png (image/png)
jenkins-config-validation-ok.png (image/png)
job-config.png (image/png)
job-config-check.png (image/png)


Source code:
Q-Gate.js
Gates to walk through
A quantum computer is just a collection of
qubits.
These qubits hold values like
1
, 0
, or some value inbetween.
A quantum computer
is able to calculate things
by changing the value of its qubits over time.
We tell the computer exactly how it should change
the value of a qubit
by instructing it to
“walk through” a series of
quantum gates.
As the qubit
“walks through” each gate
its value is changed based on the type of gate
it is passing through.
Contrary to what pop-science might tell you, there is nothing random or unpredictable about this process. Mathematically, a qubit is just a matrix. Similarly, a quantum gate is also just a matrix. To apply a gate to a qubit is to multiply these matrices together. To demonstrate this, let’s begin with a “Horizontal” qubit—commonly thought of as representing “off.” It has the following matrix form:
| 1 |
| 0 |
We would like to flip the value of this qubit from “off” to “on.” The result will be a “Vertical” qubit with the following matrix form:
| 0 |
| 1 |
In order to achieve this we must apply a Pauli X gate to our Horizontal qubit. Pauli X gates have the effect of “flipping” the value of a qubit. They are often thought of as the quantum equivalent of a classical NOT gate. Pauli X gates have the following matrix form:
| 0 | 1 |
| 1 | 0 |
We can now apply the Pauli X gate to the Horizontal qubit by multiplying their matrices together.
| 0 | 1 |
| 1 | 0 |
| 1 |
| 0 |
| 0 |
| 1 |
As anticipated, the resulting product matrix represents a Vertical qubit. (Warm fuzzies all around.)
Note how the gate’s matrix is the first factor and the qubit’s matrix is the second factor. The order matters because matrix multiplication is not commutative. With plain numbers the order of the factors does not change the product outcome. a × b = b × a. But with matrices the order does matter. [ a ] × [ b ] ≠ [ b ] × [ a ]. See matrix multiplication for an in-depth explanation.
Applying gates with code
Let’s look at three different ways
to apply a gate to a qubit
using Q’s API.
In this first example we will access
our gate’s matrix directly
and multiply it against our qubit—which is itself a matrix.
(Q.Qubit
extends Q.Matrix
and thereby inherits Q.Matrix
’s methods.
Meanwhile, Q.Gate
does not extend Q.Matrix
,
as it is sometimes desirable to create gates without matrices.
See Gates without matrices below for more details.)
Q.Gate.PAULI_X
.matrix
.multiply( Q.Qubit.HORIZONTAL )
.isEqualTo( Q.Qubit.VERTICAL )
true
Rather than access our gate’s matrix directly,
we can instead call the instance method
applyToQubit
.
Q.Gate.PAULI_X
.applyToQubit( Q.Qubit.HORIZONTAL )
.isEqualTo( Q.Qubit.VERTICAL )
true
We can also begin with the qubit rather than the gate.
Q.Qubit.HORIZONTAL
.applyGate( Q.Gate.PAULI_X )
.isEqualTo( Q.Qubit.VERTICAL )
true
Gates without matrices
In quantum computing theory a quantum gate is a matrix. But Q expands this notion of a “gate” to the more abstract notion of an “operation”—any function that is performed upon a qubit.
The punchline
While applying gates to qubits in the above fashion is useful
for some debugging and
for building single-qubit state visualizations,
it has no practical use for
full circuit evaluation as
it cannot represent the state of
a multiple-qubit system, let alone
quantum entanglement.
For that we will need a proper
Circuit
class
for simulating multi-qubit states.
Constructor
Gate
Function( params: Object ) => Q.Gate
Expects a single object whose properties
will be applied directly to this gate instance.
No particular properties are required
and even the object argument itself is optional.
The properties not listed as “optional” below
are ones that will be assigned defaults
upon instantiation by the constructor.
Any remaining properties listed below would be undefined
unless supplied as arguments.
Here we will create a “gup” gate
that borrows its matrix
property
from the pre-existing PAULI_X
gate
constant.
This will enable our custom gate
to flip
qubits from a
horizontal state,
ie. “off” or 0,
to a vertical state,
ie. “on” or 1,
and back again—just like a
PAULI_X
gate.
var gup = new Q.Gate({
symbol: 'G',
name: 'Gup',
nameCss: 'gup',
matrix: Q.Gate.PAULI_X.matrix
})
We can now test that our new
gup
gate
flips qubit states between 0
and 1.
// Verify a “Horizontal” qubit has a value of |0⟩ // and a “Vertical” qubit has a value of |1⟩. Q.Qubit.HORIZONTAL.toStateVectorText()
"|0⟩"Q.Qubit.VERTICAL.toStateVectorText()
"|1⟩"// Now flip a “Horizontal” |0⟩ to a “Vertical” |1⟩ // and flip a “Vertical” |1⟩ to a “Horizontal” |0⟩. gup.applyToQubit( Q.Qubit.HORIZONTAL ) .toStateVectorText()
"|1⟩"gup.applyToQubit( Q.Qubit.VERTICAL ) .toStateVectorText()
"|0⟩"
We can similarly use a qubit’s
applyGate
method
which internally calls a gate’s
applyToQubit
method:
Q.Qubit.HORIZONTAL // Value begins at |0⟩. .applyGate( gup ) // Value is now |1⟩. .toStateVectorText()// Output that as text.
"|1⟩"Q.Qubit.VERTICAL // Value begins at |1⟩. .applyGate( gup ) // Value is now |0⟩. .toStateVectorText()// Output that as text.
"|0⟩"
We can also do this in one go:
Q.Qubit.HORIZONTAL // Value begins at |0⟩.
.applyGate( gup ) // Value is now |1⟩.
.applyGate( gup ) // Value is back to |0⟩.
.toStateVectorText()// Output that as text.
"|0⟩"
-
- symbol
String
One or two non-numeric characters used as a unique identifier among gates, and as a label in visual representations such as circuit diagrams. Will default to"?"
if undefined at creation. -
- symbolAmazonBraket
String
Identifier to be used for this gate when exporting circuit data as Amazon Braket code. If not supplied to the constructor,Gate
will define this value asthis.symbol.toLowerCase()
. -
- symbolSvg
String [optional]
A visual representation of this gate’s symbol in scalable vector graphic format. -
- name
String
The full name of this gate to be used as a title or long label in a visual representations, etc. Will default to"Unknown"
if undefined at creation. -
- nameCss
String
Identifier to be used in constructing a Cascading Style Sheet class name as defined inQ-Circuit-Editor.css
. Will default to"unknown"
if undefined at creation. -
- matrix
Q.Matrix [optional]
The matrix representation of this gate operation’s logic, if one exists. (All true quantum gates will have a matrix representation, but some visualization operations—such as the creation of a Bloch sphere—will not.) -
- applyToQubit
Function
An action to be performed upon an inputQubit
instance. If not supplied to theGate
constructor,Gate
will create an operation that multiplies the input qubit by the gate instance’smatrix
. If the gate instance’smatrix
is undefined,Gate
will create an operation that simply returns the input qubit untouched. While this is useful for inspection and debugging a single gate’s functionality, or building a visualization of a single qubit’s changing state, it has no practical use for circuit evaluation as it cannot represent the state of a multiple-qubit system, let alone entanglement. -
- index
Number
An auto-incrementing identification number assigned to the instance, used for minding the total number of instances created.
Static properties
-
- index
Number
The number of instances created so far. -
- findBy
Function( key: String, value: * ) ⇒ Q.Gate
Returns the first object withinQ.Gate.constants
to satisfy the constraintobject[ key ] === value
. -
- findBySymbol
Function( symbol: String ) ⇒ Q.Gate
Returns the result of calling the static methodfindBy
with"symbol"
as thekey
argument andsymbol
as the value argument. -
- findByName
Function( name: String ) ⇒ Q.Gate
Returns the result of calling the static methodfindBy
with"name"
as thekey
argument andname
as the value argument.
Constants and constant creation
-
- constants
Object
Constants are appended directly to theQ.Gate
object. For convenience they are also appended to thisQ.Gate
.constants object to make looking up constants in the JavaScript console trivial, and to make iterating across all constants convenient via functions likeObject.entries
,Object.keys
,Object.values
, and so on. The intention that a property act as a constant is signaled by its labelling in all-uppercase. -
- createConstant
Function( key: String, value: * )
Appends a property named bykey
with a value ofvalue
to both theGate
object and itsconstants
property. -
- createConstants
Function( … )
Expects an even number of arguments. Will use each pair in the sequence of arguments to callcreateConstant
.
Gates of small consequence
-
- IDENTITY
Q.Gate
An Identity gate has no effect on the value of the qubit it operates on; equivalent to multiplying a value by one. (Generally when a circuit is created from text or another source, any included identity gates are ignored. It is included here for completeness.)
Matrix representation as declared innew Q.Gate({ symbol: 'I', name: 'Identity', nameCss: 'identity', matrix: Q.Matrix.IDENTITY_2X2 })
Q.Matrix.IDENTITY_2X2
:1 0 0 1 -
- CURSOR
Q.Gate
Mathematically the “identity cursor” is equivalent to theIDENTITY
gate, however it is used by the visual circuit editor as a placeholder when a user is building controlled gates or swap gates (which operate on multiple qubits) from individual components. This is a novel Q invention.
Matrix representation as declared innew Q.Gate({ symbol: '*', name: 'Identity', nameCss: 'identity', matrix: Q.Matrix.IDENTITY_2X2 })
Q.Matrix.IDENTITY_2X2
:1 0 0 1
Standard single-qubit gates
-
- HADAMARD
Q.Gate
Applies a Hadamard transform to a single qubit. For the basis qubit states of 0 and 1 this has the effect of putting a qubit into superposition. It represents a rotation on the Bloch sphere around the Z-axis by π radians, followed by a rotation around the Y-axis by π÷2 radians.
Matrix representation:new Q.Gate({ symbol: 'H', name: 'Hadamard', nameCss: 'hadamard', matrix: Q.Matrix( [ Math.SQRT1_2, Math.SQRT1_2 ], [ Math.SQRT1_2, -Math.SQRT1_2 ] ) })
×1 1 1 -1 1 √ 2 -
- PAULI_X
Q.Gate
The Pauli X gate represents a rotation on the Bloch sphere around the X-axis by π radians. It is the quantum equivalent of the classical NOT gate in that it maps 0 to 1 and 1 to 0.
Matrix representation:new Q.Gate({ symbol: 'X', name: 'Pauli X', nameCss: 'pauli-x', matrix: Q.Matrix( [ 0, 1 ], [ 1, 0 ] ) })
0 1 1 0 -
- PAULI_Y
Q.Gate
The Pauli Y gate represents a rotation on the Bloch sphere around the Y-axis by π radians. It maps 0 to i1 and 1 to -i0.
Matrix representation:new Q.Gate({ symbol: 'Y', name: 'Pauli Y', nameCss: 'pauli-y', matrix: Q.Matrix( [ 0, new Q.ComplexNumber( 0, -1 )], [ new Q.ComplexNumber( 0, 1 ), 0 ] ) })
0 -i i 0 -
- PAULI_Z
Q.Gate
The Pauli Z gate represents a rotation on the Bloch sphere around the Z-axis by π radians. It is a special case of a Phase shift gate where ϕ = π, and is therefore sometimes referred to as a “phase-flip” gate. It leaves the basis state 0 unchanged and maps 1 to -1.
Matrix representation:new Q.Gate({ symbol: 'Z', name: 'Pauli Z', nameCss: 'pauli-z', matrix: Q.Matrix( [ 1, 0 ], [ 0, -1 ] ) })
1 0 0 -1 -
- PHASE
Q.Gate
Phase gates are a family of quantum gates that employ the variable ϕ (phi) to represent tracing a horizontal arc (a line of latitude) of ϕ radians around the Bloch sphere. They leave the basis state 0 unchanged and map 1 to eiϕ 1. The probability of measuring a 0 or 1 is unchanged after applying a phase shift, however it modifies the phase of the quantum state. This particular form used for ourPHASE
constant represents a rotation on the Bloch sphere around the Z-axis of π ÷ 2 radians.
Note that there is no explicitly definednew Q.Gate({ symbol: 'P', name: 'Phase', nameCss: 'phase', updateMatrix$: function( phi ){ if( Q.isUsefulNumber( phi ) === true ) this.phi = phi this.matrix = new Q.Matrix( [ 1, 0 ], [ 0, Q.ComplexNumber.E.power( new Q.ComplexNumber( 0, this.phi ))] return this }, applyToQubit: function( qubit, phi ){ if( Q.isUsefulNumber( phi ) !== true ) phi = this.phi const matrix = new Q.Matrix( [ 1, 0 ], [ 0, Q.ComplexNumber.E.power( new Q.ComplexNumber( 0, phi ))] ) return new Q.Qubit( matrix.multiply( qubit )) } })
matrix
property. It will be created upon instantiation when the constructor calls the argument object’supdateMatrix$
function. Matrix representation (when ϕ = 1):1 0 0 ei
Using varying values for ϕ is easy. We can clone this PHASE constant, provide it a newsymbol
(so it has a unique identifier), and a new value for ϕ. In this example we create a gate calledfox
with a ϕ value of π.
Our value of ϕ is now set equal to π and we can apply this gate to any qubit.var fox = Q.Gate.PHASE.clone({ symbol: 'F', phi: Math.PI })
But we can also send a temporary value for ϕ that will be used only during this function execution; it will not changefox.applyToQubit( Q.Qubit.DIAGONAL ).toTsv()
" 0.707 -0.707"fox
’s set value of ϕ. Let’s try temporarily setting ϕ to π ÷ 4.
Rather than begin our expression with a gate, we can instead begin with a qubit, and then apply ourfox.applyToQubit( Q.Qubit.DIAGONAL, Math.PI / 4 ).toTsv()
" 0.707 0.5 + 0.5i"fox
gate to it.
But what’s more clever is that additional arguments will be passed directly to the gate’sQ.Qubit.DIAGONAL .applyGate( fox ) .toTsv()
" 0.707 -0.707"applyToQubit
method, so we can still use temporary values for ϕ.Q.Qubit.DIAGONAL .applyGate( fox, Math.PI / 4 ) .toTsv()
" 0.707 0.5 + 0.5i" -
- PI_8
Q.Gate
The π ÷ 8 gate is a special case of a Phase shift gate where the ϕ (phi) variable is set to π ÷ 4. (But why is it called “π ÷ 8” when it actually divides π by 4?) Like all phase shift gates, it represents a rotation on the Bloch sphere around the Z-axis.
Matrix representation:new Q.Gate({ symbol: 'T', name: 'π ÷ 8', nameCss: 't', matrix: Q.Matrix( [ 1, 0 ], [ 0, Q.ComplexNumber.E.power( new Q.ComplexNumber( 0, Math.PI / 4 )) ] ) })
1 0 0 eiπ ÷ 4
Multi-qubit gates
-
- SWAP
Q.Gate
The Swap gate swaps the value of two qubits. It is defined here with respect to the bases 00, 01, 10, and 11.
Matrix representation:new Q.Gate({ symbol: 'S', name: 'Swap', nameCss: 'swap', matrix: Q.Matrix( [ 1, 0, 0, 0 ], [ 0, 0, 1, 0 ], [ 0, 1, 0, 0 ], [ 0, 0, 0, 1 ]) ) })
1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 -
- SWAP1_2
Q.Gate
The √Swap gate performs half of a swap between two qubits. It is not maximally entangling. More than one application of it is required to produce a Bell state from its product states. It is defined here with respect to the bases 00, 01, 10, and 11.
Matrix representation:new Q.Gate({ symbol: '√', name: '√Swap', nameCss: 'swap1-2', matrix: Q.Matrix( [ 1, 0, 0, 0 ], [ 0, new Q.ComplexNumber( 0.5, 0.5 ), new Q.ComplexNumber( 0.5, -0.5 ), 0 ], [ 0, new Q.ComplexNumber( 0.5, -0.5 ), new Q.ComplexNumber( 0.5, 0.5 ), 0 ], [ 0, 0, 0, 1 ]) ) })
1 0 0 0 0
× (1 + i)1 2
× (1 - i)1 2 0 0
× (1 - i)1 2
× (1 + i)1 2 0 0 0 0 1
Implicit gates
Q.Circuit
supports several multi-qubit gates implictly
through composition,
rather than explicitly with Gate
constants.
For example,
Q does not explictly define a
Controlled-Not (CNOT) gate,
Controlled Swap (Fredkin) gate,
Toffolli (CCNOT) gate,
and so on
because they are all easily composed
by adding a control matrix
to any existing gate matrix.
Prototype properties
-
- clone
Function ⇒ Q.Gate
Returns a newGate
instance with properties cloned from this instance. -
- applyToQubits
Function( Q.Qubit, … ) ⇒ Array
Calls the instance methodapplyToQubit
for each suppliedQ.Qubit
argument and returns an Array of results. For example:
The above will return:Q.Gate.PAULI_X.applyToQubits( Q.Qubit.HORIZONTAL, Q.Qubit.VERTICAL, … )
[ Q.Qubit.VERTICAL, Q.Qubit.HORIZONTAL, … ]
Or for even more fun with Arrays of qubits:
While this is useful for inspection and debugging a single gate’s functionality, or building a visualization of a single qubit’s changing state, it has no practical use for circuit evaluation as it cannot represent the state of a multiple-qubit system, let alone entanglement. Will not return aQ.Gate.IDENTITY .applyToQubits( ...Object.values( Q.Qubit.constants ) ) .map( Q.Qubit.toText )
[ " 1↵0", // Horizontal " 0↵1", // Vertical " 0.707↵ 0.707", // Diagonal " 0.707↵-0.707", // Anti-Diagonal " 0.707↵-0.707i",// Right-hand Circular Polarized " 0.707↵ 0.707i" // Left-hand Circular Polarized ]Q.Gate
instance, and therefore halts “Fluent interface” method chaining along this prototype. -
- set$
Function( key: String, value: * ) ⇒ Q.Gate
Sets a property on this instance with a key ofkey
and a value ofvalue
, then returns the instance.


It is quite common practice to carry everything that was in the initial data throughout the whole analysis
Reducing the data size would reduce the needed resources (space, ram, etc.)
Usually having a mapping between initial data and processed data would be sufficient
“I hope I didn’t forget anything”-problem
This is especially problematic when working remotely as transferring full datasets is slower than transferring increments
Problem can be minimized when using data analysis libraries such as pandas that allow for easy data merging from multiple sources
This is closely related to the “She’ll have the steak”-problem
“She’ll have the steak”-problem
Quite often workflows happen in the following way:
Data inspection tools are written to inspect data.
Coding framework & data format is chosen based on how easy data is to load for inspection.
Data needs to be used with a model / solver, but data format has already been chosen.
Data fits to the model / solver poorly.
“She’ll have the steak”-problem
A better solution would be to look at the problem from the other end:
Model / solver is chosen.
Coding framework & data format is chosen based on how easy data is to use with a model.
Data inspection tools are written based on the framework.
Data fits well into the model / solver.
“She’ll have the steak”-problem
Major frameworks usually have a preferred way of working with data (e.g. tidy data with Pandas, data loaders for deep learning toolkits, NetCDF for physics simulations, …)
Downside is that one might need to write visualization tools with respect to the data formats needed by these frameworks
Upside is other people are doing the same thing: there are lots of already existing tools
Profiling vs understanding
Profiling vs understanding
Quite often when talking about I/O we’ll use terms such as Megabytes per second or I/O operations per second
Profiling is good, but more often understanding what we’re trying to accomplish with the data is more important
Knowing that you’re shoveling crap fast doesn’t help with the fact that you’re still shoveling crap
Profiling vs understanding
Computers will try to do what they are told to do, even if that is inefficient
Often we need to ask how the computer perceives what we’re telling it to do
Example in understanding a problem
Common problem in deep learning is related to randomness:
We want to randomize our data ordering for each epoch
Example in understanding a problem
This is problematic, as random access is much slower than sequential access
To fix this, we give up some degree of randomness for increased efficiency
Example in understanding a problem
Consider shuffling of a deck of playing cards:
Example in understanding a problem
Instead of shuffling the deck, we split the deck into multiple batches:
Example in understanding a problem
We shuffle the batches randomly:
Example in understanding a problem
We shuffle the data within each batch:
Example in understanding a problem
Is this ordering random enough?
More often than not, it is.
Example in understanding a problem
This kind of IO can be done sequentially.
We still get randomization, but not complete randomization.
Vast majority of big data analysis uses this.
This was used in the demo as well.
Conclusions
Conclusions
I/O problems are often tied to the way we’re working
To solve them, we need to look at our workflows
Looking at the problem from the computer’s point of view can help


The dynamically updated Quantity/Subtotal section is optimized for screen reader users.
As options are checked or unchecked, the new Quantity and Subtotal information is announced for screen reader users.


SUCKERS CANDY STORE
BUY NOW
FAQ
CONTACT US
The manliest sucker a sucker can buy.
> The suspense is terrible. I hope it'll last.
Finger Looking Good!


Testing in Recipes¶
All recipes need tests. Here are some tips, tricks, and justifications.
Simple Existence Tests¶
Sometime tests for the underlying code base don’t exist. And sometimes test suites simply take too long to run on limited CI infrastructure. Or sometimes they take too much bandwidth. Whatever the reason, conda-forge may not always be able to execute the prescribed test suite.
However, this is no reason for the recipe to not have tests. At the very least we want to verify that the package is installed the desired files in the desired locations. This is called existence testing.
Existence testing can be accomplished in the meta.yaml
file in the test/commands
block. On posix systems, use the test
utility and the $PREFIX
variable.
On Windows, use the exist
command. See below for an example.
Simple Existence Testing Example:
test:
commands:
- test -f $PREFIX/lib/libboost_log.dylib # [osx]
- test -f $PREFIX/lib/libboost_log.so # [linux]
- if not exist %PREFIX%\\Library\\lib\\boost_log-vc140-mt.lib exit 1 # [win and py35]
Run Docker Tests Locally for Feedstock¶
If you want to run the docker tests for a feedstock locally, go to the root
feedstock directory and run, the ci_support/run_docker_build.sh
script.
$ cd my-feedstock
$ ./ci_support/run_docker_build.sh
Run Docker Tests Locally for Staged Recipes¶
If you want to run the docker tests for the staged-recipes repository locally, go to
the root repository directory and run, the scripts/run_docker_build.sh
script.
$ cd staged-recipes
$ ./scripts/run_docker_build.sh
Should a Recipe Run All of a Package’s Tests?¶
No. A recipe does not have to run all of a package’s unit or integration tests. Sometimes, this might even be impossible due to timeouts on CI services. Just test sufficiently to know that the package is in good working order.


A fullstack web developer with a wide range of skills in software development. I am passionate about developing modern web application by integrating various web technologies. Take a few minutes to go through my work. Feel free to drop me a line.
My projects


--- title: Lying with statistics author: Florian Handke date: '2020-01-20' slug: lying-with-statistics categories: - Statistic tags: - '2020' - statistics subtitle: '' summary: '' authors: [] lastmod: '2020-01-20T19:27:38+01:00' featured: no image: caption: '' focal_point: '' preview_only: no projects: [] ---
According to a study from 2013, almost half of all jobs will be replaced by artificial intelligence by 2030. Sounds dramatic, and it would be, if the basis of this statement had not been completely out of the blue.
The number of job losses (47%) comes from a study by economist Carl enedikt Frey and computer scientist Michael Osborne of Oxford University.
In their study, they asked 10 experts (robotics and computer experts) how a selection of 70 professions could be automated and then extrapolated their results to 700 more professions.
This finding is now known under the synonym “The Technology Trap”, but was initially published and disseminated by well-known newspapers (FAZ, Süddeutsche Zeitung, Zeit, etc.) without questioning the basics of the study.
In the following I will go into detail about exactly these traps. The basis for this is the book by Darrell Huff, How to lie with statistics.
The build in bias describes exactly the mistake Osborne and Frey made in their study. The foundation of the study is on shaky ground.
How big is the population of the study?
What does the population represent?
Is the population representative?
In the 1936 U.S. presidential election, a pre-election telephone poll was conducted to evaluate the chances of the candidates Landon and Roosevelt. Landon was ahead with 370 to 161 votes. The problem here: In those days, mostly rich people had their own phones. Other groups were not included. As we know today, the election was won by Roosevelt.
A report based on sampling must use a representative sample, which is one from which every source of bias has been removed.
In the field of statistics, the concept of average is very vague. Behind it can be the arithmetic mean, the median or the mode. You can play with these terms and use them to influence the statement of a study in such a way that certain characteristics are more prominent or others are weakened.
For normally distributed data data, the arithmetic mean, media and mode are the same. As soon as this is no longer the case, you provide deeper insights into data.
Suppose a company announces that the average monthly salary of its employees is $5700. If the company has a large gap in the salary structure, it is likely to use the arithmetic mean for the specification. This means that there are few top earners who pull up the average. If you look at the median or the mode, however, you will notice that most of the people in the company are the ones who earn the least, namely $2000 and the median is $3000. Median is the middle number in a sorted list of numbers
In various media one reads again and again something about the intelligence of important personalities, researchers or politicians. Irrespective of what the test’s statement is and which components it does not include, the individual values marked IQ are simply not meaningful.  Apparently, Person B is smarter than Person A. Like any other product of the sampling method IQ is a figure with a statistical error. Assuming the probable error is 3 points. Then person A would have an IQ of 95 to 101 with a 50% chance and person B would have an IQ of 98 to 104. So we see that such values cannot be considered as single, but more as a range. It could well be that person A is more tubby than person B.
In statistics, more often than not, probable error is the standard error. With a simple standard deviation, ~68.2% of the values must lie within the normally distributed values. If you want to take a closer look, you can do so via wikipedia wikipedia.
I hope my short version could help to shed some light on the statistical traps that are sometimes buzzing around.


Instance Constructors
-
new
WrappedResponse
(response: HttpServletResponse)
Value Members
-
def
!=
(arg0: AnyRef): Boolean
-
def
!=
(arg0: Any): Boolean
-
def
##
(): Int
-
def
==
(arg0: AnyRef): Boolean
-
def
==
(arg0: Any): Boolean
-
def
addCookie
(arg0: Cookie): Unit
-
def
addDateHeader
(arg0: String, arg1: Long): Unit
-
def
addHeader
(arg0: String, arg1: String): Unit
-
def
addIntHeader
(arg0: String, arg1: Int): Unit
-
def
asInstanceOf
[T0]
: T0
-
def
bytes
: Array[Byte]
-
def
clone
(): AnyRef
-
def
containsHeader
(arg0: String): Boolean
-
def
encodeRedirectURL
(arg0: String): String
-
def
encodeRedirectUrl
(arg0: String): String
-
def
encodeURL
(arg0: String): String
-
def
encodeUrl
(arg0: String): String
-
def
eq
(arg0: AnyRef): Boolean
-
def
equals
(arg0: Any): Boolean
-
def
finalize
(): Unit
-
def
flushBuffer
(): Unit
-
def
getBufferSize
(): Int
-
def
getCharacterEncoding
(): String
-
def
getClass
(): java.lang.Class[_]
-
def
getContentType
(): String
-
def
getLocale
(): Locale
-
def
getOutputStream
(): ServletOutputStream
-
def
getResponse
(): ServletResponse
-
def
getWriter
(): PrintWriter
-
def
hashCode
(): Int
-
def
isCommitted
(): Boolean
-
def
isInstanceOf
[T0]
: Boolean
-
def
ne
(arg0: AnyRef): Boolean
-
def
notify
(): Unit
-
def
notifyAll
(): Unit
-
def
output
(context: RenderContext, escape: Boolean = false): Unit
-
def
reset
(): Unit
-
def
resetBuffer
(): Unit
-
def
sendError
(arg0: Int): Unit
-
def
sendError
(arg0: Int, arg1: String): Unit
-
def
sendRedirect
(arg0: String): Unit
-
def
setBufferSize
(arg0: Int): Unit
-
def
setCharacterEncoding
(arg0: String): Unit
-
def
setContentLength
(arg0: Int): Unit
-
def
setContentType
(arg0: String): Unit
-
def
setDateHeader
(arg0: String, arg1: Long): Unit
-
def
setHeader
(arg0: String, arg1: String): Unit
-
def
setIntHeader
(arg0: String, arg1: Int): Unit
-
def
setLocale
(arg0: Locale): Unit
-
def
setResponse
(arg0: ServletResponse): Unit
-
def
setStatus
(arg0: Int, arg1: String): Unit
-
def
setStatus
(arg0: Int): Unit
-
def
synchronized
[T0]
(arg0: ⇒ T0): T0
-
def
text
: String
-
def
toString
(): String
-
def
wait
(): Unit
-
def
wait
(arg0: Long, arg1: Int): Unit
-
def
wait
(arg0: Long): Unit
Inherited from HttpServletResponseWrapper
Inherited from HttpServletResponse
Inherited from ServletResponseWrapper
Inherited from ServletResponse
Inherited from AnyRef
Inherited from Any


| re_exec {rematch2} | R Documentation |
Match a regular expression to a string, and return matches, match positions,
and capture groups. This function is like its
match
counterpart, except it returns match/capture
group start and end positions in addition to the matched values.
re_exec(text, pattern, perl = TRUE, ...) ## S3 method for class 'rematch_records' x$name ## S3 method for class 'rematch_allrecords' x$name
text |
Character vector. |
pattern |
A regular expression. See |
perl |
logical should perl compatible regular expressions be used? Defaults to TRUE, setting to FALSE will disable capture groups. |
... |
Additional arguments to pass to
|
x |
Object returned by |
name |
|
A tidy data frame (see Section “Tidy Data”). Match record entries are one length vectors that are set to NA if there is no match.
The return value is a tidy data frame where each row
corresponds to an element of the input character vector text
. The
values from text
appear for reference in the .text
character
column. All other columns are list columns containing the match data. The
.match
column contains the match information for full regular
expression matches while other columns correspond to capture groups if there
are any, and PCRE matches are enabled with perl = TRUE
(this is on by
default). If capture groups are named the corresponding columns will bear
those names.
Each match data column list contains match records, one for each element in
text
. A match record is a named list, with entries match
,
start
and end
that are respectively the matching (sub) string,
the start, and the end positions (using one based indexing).
To make it easier to extract matching substrings or positions, a special
$
operator is defined on match columns, both for the .match
column and the columns corresponding to the capture groups. See examples
below.
regexpr
, which this function wraps
Other tidy regular expression matching:
re_exec_all()
,
re_match_all()
,
re_match()
name_rex <- paste0( "(?<first>[[:upper:]][[:lower:]]+) ", "(?<last>[[:upper:]][[:lower:]]+)" ) notables <- c( " Ben Franklin and Jefferson Davis", "\tMillard Fillmore" ) # Match first occurrence pos <- re_exec(notables, name_rex) pos # Custom $ to extract matches and positions pos$first$match pos$first$start pos$first$end


Hello! Welcome to Anathema
Those images on the left/top? Click or tap them for various app features.
To edit characters and rulebooks, you'll need an unlock key. This is displayed when you create the character or rulebook, or in the admin panel.
Access to the admin panel requires the admin key. Please refer to the included admin manual for how to set this.


This pulls from the remote domain using iFrame Transports
Back to examples
We are using an alternate port for the multi-domain support. It creates a self-contained example


--- title: 'Context Menu' head: title: 'zKit: Context Menu (lib/components)' description: 'zKit, a collection of framework-agnostic components for modern web.' --- {% extends "../_inc/docs_page.html" %} {% block head_end %} {% endblock %} {% block content_main %}
Animated context menu component that does not require JavaScript coding for a basic use.
This component is framework-agnostic, it will play nicely in combination with any UI framework.
Put inside the field menu
the code of your menu items.
<div data-ui-load="@lib/components/context_menu"
data-ui-context="my-menu">
</div>
The context menu already provides basic styling for the `button` element, though you can use any kind of element and custom styling.
data-ui-load="@lib/components/context_menu"
constructorcontext_menu
component on the element.
data-ui-context
optionalvar contextMenu;
// since the component loads asynchronously
// a callback is required to ensure the component is ready
zuix.context('my-menu', function() {
// add event listeners
this
.on('open', function() { /* ... */})
.on('close', function() { /* ... */});
// store a global reference of
// the component for later use
contextMenu = this;
});
// show the menu
contextMenu.show();
// hide the menu
contextMenu.hide();
Source code is available in the lib/components
folder of zKit repository.


Reflection blog
Dec 11 2017 by Frank
Q: What's your take on the DBC/EDA experience?
A: I think it's great to gather people with the same passion together and achieve the same goals. I totally agree the idea that you will go fast when you go alone, you will go far when you go together.
Q: What are your impressions?
A: I'm so excited to find people with same passion and looking forward the coming bootcamp.
Q: How do you see yourself engaging with this type of culture?
A: I totally agree the Three Pillars, from my understanding, it means follow your heart, try your best and help others to make progress together.
Q: Have your expectations of EDA changed? If so, how?
A: This is the first week of phase 0, I think I may answer this questions by the end of the bootcamp.
Q: Are you excited to participate in this kind of learning environment? Does it make you nervous?
A: It's excited and I feel nervous a little bit. It reminds me of my first day of work. It's always great to meet new people with same passion. Looking forward to seeing you guys in coming bootcamp.


| | |
- builtins.object
-
- FiniteFieldArray
-
- ExtensionFieldArray
-
- BinaryFieldArray
- PrimeFieldArray
- FiniteFieldElement
-
- ExtensionFieldElement
-
- BinaryFieldElement
- PrimeFieldElement
class BinaryFieldArray(ExtensionFieldArray) |
| |
BinaryFieldArray(value, check=True, copy=False)
|
| |
- Method resolution order:
- BinaryFieldArray
- ExtensionFieldArray
- FiniteFieldArray
- builtins.object
Data and other attributes defined here:
- __annotations__ = {}
Methods inherited from ExtensionFieldArray:
- __repr__(self)
- Return repr(self).
Data descriptors inherited from ExtensionFieldArray:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from FiniteFieldArray:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- __contains__(self, value)
- __eq__(self, other)
- Elementwise equality as for Numpy arrays.
- __getitem__(self, key)
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imatmul__(self, other)
- In-place matrix multiplication.
- __imul__(self, other)
- In-place multiplication.
- __init__(self, value, check=True, copy=False)
- Initialize self. See help(type(self)) for accurate signature.
- __ipow__(self, other)
- In-place exponentiation.
- __irshift__(self, other)
- In-place right shift.
- __isub__(self, other)
- In-place subtraction.
- __iter__(self)
- __itruediv__(self, other)
- "In-place division.
- __len__(self)
- __lshift__(self, other)
- Left shift.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Elementwise nonequality as for Numpy arrays.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation.
- __radd__ = __add__(self, other)
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __setitem__(self, key, value)
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- compress(self, *args, **kwargs)
- copy(self, *args, **kwargs)
- diagonal(self, *args, **kwargs)
- flatten(self, *args, **kwargs)
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- nonzero(self, *args, **kwargs)
- prod(self, *args, **kwargs)
- ravel(self, *args, **kwargs)
- reciprocal(self)
- Multiplicative inverse.
- repeat(self, *args, **kwargs)
- reshape(self, *args, **kwargs)
- sqrt(self, INV=False)
- Modular (inverse) square root.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- take(self, *args, **kwargs)
- tolist(self)
- trace(self, *args, **kwargs)
- transpose(self, *axes)
Static methods inherited from FiniteFieldArray:
- diag(a, k=0)
- gauss_det(a)
- Determinant by Gaussian elimination on (last 2 dimensions of) array a.
- gauss_inv(A)
- Inverse by Gaussian elimination on augmented matrix (A | I).
- gauss_solve(A, B)
- Linear solve by Gaussian elimination on matrix (A | B).
- matrix_pow(A, n)
Readonly properties inherited from FiniteFieldArray:
- T
- flat
- ndim
- shape
- size
Data descriptors inherited from FiniteFieldArray:
- value
Data and other attributes inherited from FiniteFieldArray:
- __hash__ = None
|
class BinaryFieldElement(ExtensionFieldElement) |
| |
BinaryFieldElement(value)
Common base class for binary field elements. |
| |
- Method resolution order:
- BinaryFieldElement
- ExtensionFieldElement
- FiniteFieldElement
- builtins.object
Data and other attributes defined here:
- __annotations__ = {'modulus': <class 'mpyc.gfpx.BinaryPolynomial'>}
- characteristic = 2
Methods inherited from ExtensionFieldElement:
- __init__(self, value)
- Initialize self. See help(type(self)) for accurate signature.
- __int__(self)
- Extract field element as an integer value.
- __irshift__(self, other)
- In-place right shift.
- __pow__(self, other)
- Exponentiation.
- __reduce__(self)
- Helper for pickle.
- __repr__(self)
- Return repr(self).
- __rshift__(self, other)
- Right shift.
Static methods inherited from ExtensionFieldElement:
- createGF(modulus)
- Create new object for use by pickle module.
Methods inherited from FiniteFieldElement:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __bool__(self)
- Truth value testing.
Return False if this field element is zero, True otherwise.
Field elements can thus be used directly in Boolean formulas.
- __eq__(self, other)
- Equality test.
- __hash__(self)
- Make finite field elements hashable (e.g., for LRU caching).
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imul__(self, other)
- In-place multiplication.
- __isub__(self, other)
- In-place subtraction.
- __itruediv__(self, other)
- In-place division.
- __lshift__(self, other)
- Left shift.
- __mul__(self, other)
- Multiplication.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __radd__(self, other)
- Addition (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmul__(self, other)
- Multiplication (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- reciprocal(self)
- Multiplicative inverse.
- sqrt(self, INV=False)
- Modular (inverse) square root.
Class methods inherited from FiniteFieldElement:
- to_bytes(x) from builtins.type
- Return byte string representing the given list/ndarray of integers x.
Static methods inherited from FiniteFieldElement:
- from_bytes(data)
- Return the list of integers represented by the given byte string.
Data descriptors inherited from FiniteFieldElement:
- value
Data and other attributes inherited from FiniteFieldElement:
- byte_length = None
- ext_deg = None
- is_signed = None
- modulus = None
- order = None
|
class ExtensionFieldArray(FiniteFieldArray) |
| |
ExtensionFieldArray(value, check=True, copy=False)
|
| |
- Method resolution order:
- ExtensionFieldArray
- FiniteFieldArray
- builtins.object
Methods defined here:
- __repr__(self)
- Return repr(self).
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __annotations__ = {}
Methods inherited from FiniteFieldArray:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- __contains__(self, value)
- __eq__(self, other)
- Elementwise equality as for Numpy arrays.
- __getitem__(self, key)
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imatmul__(self, other)
- In-place matrix multiplication.
- __imul__(self, other)
- In-place multiplication.
- __init__(self, value, check=True, copy=False)
- Initialize self. See help(type(self)) for accurate signature.
- __ipow__(self, other)
- In-place exponentiation.
- __irshift__(self, other)
- In-place right shift.
- __isub__(self, other)
- In-place subtraction.
- __iter__(self)
- __itruediv__(self, other)
- "In-place division.
- __len__(self)
- __lshift__(self, other)
- Left shift.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Elementwise nonequality as for Numpy arrays.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation.
- __radd__ = __add__(self, other)
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __setitem__(self, key, value)
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- compress(self, *args, **kwargs)
- copy(self, *args, **kwargs)
- diagonal(self, *args, **kwargs)
- flatten(self, *args, **kwargs)
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- nonzero(self, *args, **kwargs)
- prod(self, *args, **kwargs)
- ravel(self, *args, **kwargs)
- reciprocal(self)
- Multiplicative inverse.
- repeat(self, *args, **kwargs)
- reshape(self, *args, **kwargs)
- sqrt(self, INV=False)
- Modular (inverse) square root.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- take(self, *args, **kwargs)
- tolist(self)
- trace(self, *args, **kwargs)
- transpose(self, *axes)
Static methods inherited from FiniteFieldArray:
- diag(a, k=0)
- gauss_det(a)
- Determinant by Gaussian elimination on (last 2 dimensions of) array a.
- gauss_inv(A)
- Inverse by Gaussian elimination on augmented matrix (A | I).
- gauss_solve(A, B)
- Linear solve by Gaussian elimination on matrix (A | B).
- matrix_pow(A, n)
Readonly properties inherited from FiniteFieldArray:
- T
- flat
- ndim
- shape
- size
Data descriptors inherited from FiniteFieldArray:
- value
Data and other attributes inherited from FiniteFieldArray:
- __hash__ = None
|
class ExtensionFieldElement(FiniteFieldElement) |
| |
ExtensionFieldElement(value)
Common base class for extension field elements. |
| |
- Method resolution order:
- ExtensionFieldElement
- FiniteFieldElement
- builtins.object
Methods defined here:
- __init__(self, value)
- Initialize self. See help(type(self)) for accurate signature.
- __int__(self)
- Extract field element as an integer value.
- __irshift__(self, other)
- In-place right shift.
- __pow__(self, other)
- Exponentiation.
- __reduce__(self)
- Helper for pickle.
- __repr__(self)
- Return repr(self).
- __rshift__(self, other)
- Right shift.
Static methods defined here:
- createGF(modulus)
- Create new object for use by pickle module.
Data and other attributes defined here:
- __annotations__ = {'modulus': <class 'mpyc.gfpx.Polynomial'>}
Methods inherited from FiniteFieldElement:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __bool__(self)
- Truth value testing.
Return False if this field element is zero, True otherwise.
Field elements can thus be used directly in Boolean formulas.
- __eq__(self, other)
- Equality test.
- __hash__(self)
- Make finite field elements hashable (e.g., for LRU caching).
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imul__(self, other)
- In-place multiplication.
- __isub__(self, other)
- In-place subtraction.
- __itruediv__(self, other)
- In-place division.
- __lshift__(self, other)
- Left shift.
- __mul__(self, other)
- Multiplication.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __radd__(self, other)
- Addition (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmul__(self, other)
- Multiplication (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- reciprocal(self)
- Multiplicative inverse.
- sqrt(self, INV=False)
- Modular (inverse) square root.
Class methods inherited from FiniteFieldElement:
- to_bytes(x) from builtins.type
- Return byte string representing the given list/ndarray of integers x.
Static methods inherited from FiniteFieldElement:
- from_bytes(data)
- Return the list of integers represented by the given byte string.
Data descriptors inherited from FiniteFieldElement:
- value
Data and other attributes inherited from FiniteFieldElement:
- byte_length = None
- characteristic = None
- ext_deg = None
- is_signed = None
- modulus = None
- order = None
|
class FiniteFieldArray(builtins.object) |
| |
FiniteFieldArray(value, check=True, copy=False)
Common base class for finite field arrays.
An array over finite field F behaves much like a NumPy array with dtype=F.
Conceptually, an array a over F can be thought of as, for example
"a = np.array([[F(1), F(2)], [F(0), F(3)]], dtype=F)"
Internally, however, arrays over a finite field F are represented by NumPy
arrays with dtype=object storing just the values of the finite field elements:
"a = (field=F, value=np.array([[1, 2], [0, 3]], dtype=object))"
Invariant: elements of array 'value' are reduced w.r.t. modulus. |
| |
Methods defined here:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- __contains__(self, value)
- __eq__(self, other)
- Elementwise equality as for Numpy arrays.
- __getitem__(self, key)
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imatmul__(self, other)
- In-place matrix multiplication.
- __imul__(self, other)
- In-place multiplication.
- __init__(self, value, check=True, copy=False)
- Initialize self. See help(type(self)) for accurate signature.
- __ipow__(self, other)
- In-place exponentiation.
- __irshift__(self, other)
- In-place right shift.
- __isub__(self, other)
- In-place subtraction.
- __iter__(self)
- __itruediv__(self, other)
- "In-place division.
- __len__(self)
- __lshift__(self, other)
- Left shift.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Elementwise nonequality as for Numpy arrays.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation.
- __radd__ = __add__(self, other)
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __setitem__(self, key, value)
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- compress(self, *args, **kwargs)
- copy(self, *args, **kwargs)
- diagonal(self, *args, **kwargs)
- flatten(self, *args, **kwargs)
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- nonzero(self, *args, **kwargs)
- prod(self, *args, **kwargs)
- ravel(self, *args, **kwargs)
- reciprocal(self)
- Multiplicative inverse.
- repeat(self, *args, **kwargs)
- reshape(self, *args, **kwargs)
- sqrt(self, INV=False)
- Modular (inverse) square root.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- take(self, *args, **kwargs)
- tolist(self)
- trace(self, *args, **kwargs)
- transpose(self, *axes)
Static methods defined here:
- diag(a, k=0)
- gauss_det(a)
- Determinant by Gaussian elimination on (last 2 dimensions of) array a.
- gauss_inv(A)
- Inverse by Gaussian elimination on augmented matrix (A | I).
- gauss_solve(A, B)
- Linear solve by Gaussian elimination on matrix (A | B).
- matrix_pow(A, n)
Readonly properties defined here:
- T
- flat
- ndim
- shape
- size
Data descriptors defined here:
- value
Data and other attributes defined here:
- __annotations__ = {'_mix_types': <class 'type'>, 'field': <class 'type'>}
- __hash__ = None
|
class FiniteFieldElement(builtins.object) |
| |
FiniteFieldElement(value)
Abstract base class for finite field elements.
Invariant: 'value' is reduced w.r.t. modulus. |
| |
Methods defined here:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __bool__(self)
- Truth value testing.
Return False if this field element is zero, True otherwise.
Field elements can thus be used directly in Boolean formulas.
- __eq__(self, other)
- Equality test.
- __hash__(self)
- Make finite field elements hashable (e.g., for LRU caching).
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imul__(self, other)
- In-place multiplication.
- __init__(self, value)
- Initialize self. See help(type(self)) for accurate signature.
- __int__(self)
- Extract field element as an integer value.
- __irshift__(self, other)
- In-place right shift.
- __isub__(self, other)
- In-place subtraction.
- __itruediv__(self, other)
- In-place division.
- __lshift__(self, other)
- Left shift.
- __mul__(self, other)
- Multiplication.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation.
- __radd__(self, other)
- Addition (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmul__(self, other)
- Multiplication (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- reciprocal(self)
- Multiplicative inverse.
- sqrt(self, INV=False)
- Modular (inverse) square root.
Class methods defined here:
- to_bytes(x) from builtins.type
- Return byte string representing the given list/ndarray of integers x.
Static methods defined here:
- from_bytes(data)
- Return the list of integers represented by the given byte string.
Data descriptors defined here:
- value
Data and other attributes defined here:
- __annotations__ = {'_mix_types': <class 'type'>, 'array': <class 'type'>}
- byte_length = None
- characteristic = None
- ext_deg = None
- is_signed = None
- modulus = None
- order = None
|
class PrimeFieldArray(FiniteFieldArray) |
| |
PrimeFieldArray(value, check=True, copy=False)
|
| |
- Method resolution order:
- PrimeFieldArray
- FiniteFieldArray
- builtins.object
Methods defined here:
- __abs__(self)
- Absolute value of (signed) value.
- __int__(self)
- Extract (signed) integer value for size-1 arrays only.
- __repr__(self)
- Return repr(self).
- signed_(self)
- Return signed integer representation, symmetric around zero.
- unsigned_(self)
- Return unsigned integer representation.
Class methods defined here:
- intarray(a) from builtins.type
- Extract finite field array as a (signed) integer array.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __annotations__ = {}
Methods inherited from FiniteFieldArray:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __array_ufunc__(self, ufunc, method, *inputs, **kwargs)
- __contains__(self, value)
- __eq__(self, other)
- Elementwise equality as for Numpy arrays.
- __getitem__(self, key)
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imatmul__(self, other)
- In-place matrix multiplication.
- __imul__(self, other)
- In-place multiplication.
- __init__(self, value, check=True, copy=False)
- Initialize self. See help(type(self)) for accurate signature.
- __ipow__(self, other)
- In-place exponentiation.
- __irshift__(self, other)
- In-place right shift.
- __isub__(self, other)
- In-place subtraction.
- __iter__(self)
- __itruediv__(self, other)
- "In-place division.
- __len__(self)
- __lshift__(self, other)
- Left shift.
- __matmul__(self, other)
- Matrix multiplication.
- __mul__(self, other)
- Multiplication.
- __ne__(self, other)
- Elementwise nonequality as for Numpy arrays.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __pow__(self, other)
- Exponentiation.
- __radd__ = __add__(self, other)
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmatmul__(self, other)
- Matrix multiplication (with reflected arguments).
- __rmul__ = __mul__(self, other)
- __rpow__(self, other)
- Exponentiation (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rshift__(self, other)
- Right shift.
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __setitem__(self, key, value)
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- compress(self, *args, **kwargs)
- copy(self, *args, **kwargs)
- diagonal(self, *args, **kwargs)
- flatten(self, *args, **kwargs)
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- nonzero(self, *args, **kwargs)
- prod(self, *args, **kwargs)
- ravel(self, *args, **kwargs)
- reciprocal(self)
- Multiplicative inverse.
- repeat(self, *args, **kwargs)
- reshape(self, *args, **kwargs)
- sqrt(self, INV=False)
- Modular (inverse) square root.
- sum(self, *args, **kwargs)
- swapaxes(self, axis1, axis2)
- take(self, *args, **kwargs)
- tolist(self)
- trace(self, *args, **kwargs)
- transpose(self, *axes)
Static methods inherited from FiniteFieldArray:
- diag(a, k=0)
- gauss_det(a)
- Determinant by Gaussian elimination on (last 2 dimensions of) array a.
- gauss_inv(A)
- Inverse by Gaussian elimination on augmented matrix (A | I).
- gauss_solve(A, B)
- Linear solve by Gaussian elimination on matrix (A | B).
- matrix_pow(A, n)
Readonly properties inherited from FiniteFieldArray:
- T
- flat
- ndim
- shape
- size
Data descriptors inherited from FiniteFieldArray:
- value
Data and other attributes inherited from FiniteFieldArray:
- __hash__ = None
|
class PrimeFieldElement(FiniteFieldElement) |
| |
PrimeFieldElement(value)
Common base class for prime field elements. |
| |
- Method resolution order:
- PrimeFieldElement
- FiniteFieldElement
- builtins.object
Methods defined here:
- __abs__(self)
- Absolute value of (signed) value.
- __init__(self, value)
- Initialize self. See help(type(self)) for accurate signature.
- __int__(self)
- Extract field element as a (signed) integer value.
- __irshift__(self, other)
- In-place right shift.
- __pow__(self, other)
- Exponentiation.
- __reduce__(self)
- Helper for pickle.
- __repr__(self)
- Return repr(self).
- __rshift__(self, other)
- Right shift.
- signed_(self)
- Return signed integer representation, symmetric around zero.
- unsigned_(self)
- Return unsigned integer representation.
Static methods defined here:
- createGF(p, n, w)
- Create new object for use by pickle module.
Data and other attributes defined here:
- __annotations__ = {'modulus': <class 'int'>}
- is_signed = None
- nth = None
- root = None
Methods inherited from FiniteFieldElement:
- __add__(self, other)
- Addition.
- __array_function__(self, func, types, args, kwargs)
- __bool__(self)
- Truth value testing.
Return False if this field element is zero, True otherwise.
Field elements can thus be used directly in Boolean formulas.
- __eq__(self, other)
- Equality test.
- __hash__(self)
- Make finite field elements hashable (e.g., for LRU caching).
- __iadd__(self, other)
- In-place addition.
- __ilshift__(self, other)
- In-place left shift.
- __imul__(self, other)
- In-place multiplication.
- __isub__(self, other)
- In-place subtraction.
- __itruediv__(self, other)
- In-place division.
- __lshift__(self, other)
- Left shift.
- __mul__(self, other)
- Multiplication.
- __neg__(self)
- Negation.
- __pos__(self)
- Unary +.
- __radd__(self, other)
- Addition (with reflected arguments).
- __rlshift__(self, other)
- Left shift (with reflected arguments).
- __rmul__(self, other)
- Multiplication (with reflected arguments).
- __rrshift__(self, other)
- Right shift (with reflected arguments).
- __rsub__(self, other)
- Subtraction (with reflected arguments).
- __rtruediv__(self, other)
- Division (with reflected arguments).
- __sub__(self, other)
- Subtraction.
- __truediv__(self, other)
- Division.
- is_sqr(self)
- Test for quadratic residuosity (0 is also square).
- reciprocal(self)
- Multiplicative inverse.
- sqrt(self, INV=False)
- Modular (inverse) square root.
Class methods inherited from FiniteFieldElement:
- to_bytes(x) from builtins.type
- Return byte string representing the given list/ndarray of integers x.
Static methods inherited from FiniteFieldElement:
- from_bytes(data)
- Return the list of integers represented by the given byte string.
Data descriptors inherited from FiniteFieldElement:
- value
Data and other attributes inherited from FiniteFieldElement:
- byte_length = None
- characteristic = None
- ext_deg = None
- modulus = None
- order = None
| |


{% extends "registration/auth_base.html" %} {% block auth_content %}
Your password has been reset. You may go ahead and Login now.


{{widget type="cms/widget_block" template="cms/widget/static_block/default.phtml" block_id="44"}}
Should you need to ship your WaterRower for any reason, please retain the original packaging to ensure your machine will be transported without damage. If you need to purchase an additional set of shipping boxes, they are available for purchase. Please contact<EMAIL_ADDRESS>for details.
Instructions for repacking a DUAL RAIL unit:
Instructions for repacking a MONORAIL unit (including A1, GX):


The concept is to make a non-verbal way to a product where users could access
their smart home system by using a hand gesture.
The product will smartly analyze users hand gesture and do certain commands that are set beforehand.
How to use Ruka
Use 'Five' Hand Gesture to Start and to End the command
Between start and end, there will be 2 hand gestures you could do in order to run a command.
Two Hand Gestures
( 4, 0 ) Show the news
( 4, 1 ) Show entertainment news
( 4, 2 ) Show technology news
( 3, 0 ) Show the weather now
(cont. ) Two Hand Gestures
( 2, 0 ) Make an alarm tomorrow at 6
( 1, 0 ) Turn off all lights
( 1, 2 ) Turn on all lights
( 3, 2 ) Show the notification


See: Description
| Class | Description |
|---|---|
| AbstractComponentDependencyGraphFormatter<G extends AbstractDependencyGraph<?>> |
Abstract superclass for formatters for component-based dependency graphs.
|
| AbstractDependencyGraph<T extends ISystemModelElement> |
Abstract superclass for dependency graphs.
|
| AbstractDependencyGraphFilter<T extends ISystemModelElement> |
Refactored copy from LogAnalysis-legacy tool.
|
| AbstractDependencyGraphFormatter<G extends AbstractDependencyGraph<?>> |
Abstract superclass for all dependency-graph formatters.
|
| AbstractDependencyGraphFormatterVisitor<T extends ISystemModelElement> |
Abstract base class for dependency-graph-formatting visitors.
|
| AbstractNodeDecorator |
Abstract superclass for all node decorators.
|
| AbstractOperationDependencyGraphFormatter<T extends AbstractDependencyGraph<?>> |
Abstract for formatters for operation-level dependency graph.
|
| ComponentAllocationDependencyGraph |
This class represents component dependency graphs on the allocation level.
|
| ComponentAllocationDependencyGraphFormatter |
Formatter class for component dependency graphs on the allocation level (see
ComponentAllocationDependencyGraph ) . |
| ComponentAssemblyDependencyGraph |
This class represents component dependency graphs on the assembly level.
|
| ComponentAssemblyDependencyGraphFormatter |
Formatter class for component dependency graphs on the assembly level (see
ComponentAssemblyDependencyGraph ). |
| ComponentDependencyGraphAllocationFilter |
Refactored copy from LogAnalysis-legacy tool
This class has exactly one input port named "in". |
| ComponentDependencyGraphAssemblyFilter |
Refactored copy from LogAnalysis-legacy tool
This class has exactly one input port named "in". |
| ContainerDependencyGraph |
This class represents container dependency graphs.
|
| ContainerDependencyGraphFilter |
Refactored copy from LogAnalysis-legacy tool
This class has exactly one input port named "in". |
| ContainerDependencyGraphFormatter |
Formatter for container dependency graphs.
|
| DependencyGraphNode<T extends ISystemModelElement> |
This class represents a single node within a dependency graph.
|
| OperationAllocationDependencyGraph |
This class represents operation dependency graphs on the allocation level.
|
| OperationAllocationDependencyGraphFormatter |
Formatter for operation dependency graphs on the allocation level (see
OperationAllocationDependencyGraph ). |
| OperationAssemblyDependencyGraph |
This class represents operation dependency graphs on the assembly level.
|
| OperationAssemblyDependencyGraphFormatter |
Formatter for operation dependency graphs on the assembly level (see
OperationAssemblyDependencyGraph ). |
| OperationDependencyGraphAllocationFilter |
Refactored copy from LogAnalysis-legacy tool
This class has exactly one input port named "in". |
| OperationDependencyGraphAssemblyFilter |
Refactored copy from LogAnalysis-legacy tool
This class has exactly one input port named "in". |
| ResponseTimeColorNodeDecorator |
Decorator to set the color of graph nodes depending on graph nodes execution time.
|
| ResponseTimeDecoration |
Response time decoration for graph vertices.
|
| ResponseTimeNodeDecorator |
Decorator to attach response time data to graph nodes.
|
| WeightedBidirectionalDependencyGraphEdge<T extends ISystemModelElement> |
This class represents a weighted but bidirected edge within a dependency graph.
|
Copyright 2021 Kieker Project, http://kieker-monitoring.net


2023 DJ, Zürich Pride 2023, Daniel H Bar, Zurich, Switzerland
2022 DJ, Back in Black X robot_mixeur, Daniel H Bar, Zurich, Switzerland
2022 DJ, Cortège X robot_mixeur, Daniel H Bar, Zurich, Switzerland
2022 DJ/Live, Thai Disco 12 XXL, Sender, Zurich, Switzerland
2021 DJ/Live, Jazz in der Manegg, Studio D, Zurich Switzerland
2021 DJ/Live, Thai Disco #11, Studio D, Zurich, Switzerland
2020 DJ/Live, Thai Disco #10, Studio D, Zurich, Switzerland
2020 DJ/Live, Thai Disco #9, Studio D, Zurich, Switzerland
2020 DJ/Live, Thai Disco #8, Studio D, Zurich, Switzerland
2020 DJ/Live, Thai Disco #7, Studio D, Zurich, Switzerland
2020 DJ, Sihlmättli, Restaurant Sihlmättli, Zurich, Switzerland
2019 DJ/Live, Thai Disco #6, Studio D, Zurich, Switzerland
2019 DJ/Live, Thai Disco #5, Studio D, Zurich, Switzerland
2019 DJ/Live, Thai Disco #4, Studio D, Zurich, Switzerland
2019 Worker, Play by Urs Fischer, Mario Winkler Company, Zurich, Switzerland
2019 Go-Go Dancer, Felix Gonzalez-Torres- Untitled Gogo Dancing Platform Migros Museum Zurich, Switzerland
2018 DJ/Live, Thai Disco #3, Studio D, Zurich, Switzerland
2018 Model, Walter Pfeiffer's Book BILDRAUSCH.DRAWINGS 1966 – 2018, Zurich, Switzerland
2018 DJ/Live, Thai Disco #2, Studio D, Zurich, Switzerland
2017 DJ/Live, Thai Disco #1, Studio D, Zurich, Switzerland
2017 Model, URS AUGUST STEINER & WALTER PFEIFFER: smokegetsinyoureyes Zurich, Switzerland
2016 VJ, EXPLODING PLASTIC & INEVITABLE REDUX, Lausanne, Switzerland
2016 VJ, KunterMunter, Olten, Switzerland
2015 VJ, KunterMunter, Olten, Switzerland
2015 VJ, Electroziles Festival: Derrick May X scheinwerfer.li, Sion, Switzerland
2013 Collective, GIBSMIR Rodeo, Zurich, Switzerland
2012 VJ, Zouk Club Velvet Underground Dance: Henrik Schwarz X scheinwerfer.li, Singapore
2012 VJ, Zouk Club Tanzen im Samten Untergrund X scheinwerfer.li, Singapore
2012 VJ Resident, Tunnel Club Final Exit: Franco Bianco, Channel X, Sascha Brämer, Luzern, Switzerland
2012 Collective, GIBSMIR Anonymous Auction 3, Zurich, Switzerland
2012 Collevtive, Collective Show, L.A., Tree Structure Los Angeles, USA
2011 Collective, 2nd Anonymous GIBSMIR Art Auction, Zurich, Switzerland
2011 Collective, GIBSMIR Action Auction, Art Basel, Basel, Switzerland
2010 Installation, Pfingstweide Club, Zurich Switzerland
2010 Installation, Annual Victoria Art Craw, Victoria, Canada
2009 DJ/Live, Starkart Exhibitions, Zurich, Switzerland
2009 Installation, Lawrence II, University of Victoria Graduation Show, Victoria, Canada
2008 Installation, SMOKE LODGE, Victoria, Canada
2008 Installation, Sprung Event feat. Aubrey the Burke, Victoria, Canada
https://robotized.arisona.ch / http://www.telebody.ws / http://www.aubreytheburke.com / http://www.augu.st / http://veronikaspierenburg.com / https://www.roland-ramseier.ch / https://www.milkoboyarov.com / http://foundation.to / http://www.curtisoland.com / http://www.mariowinkler.ch / http://www.walterpfeiffer-chasing-beauty.ch
BOOKING & CONTACT<EMAIL_ADDRESS>All images © 2023 Marcel Andreas Reimer
Coded with love in Zurich Switzerland


Everything Worked!
Thanks for checking out Armstrong! This is a static template that you can edit to fit your needs, or remove entirely if you want something else.
Please check out our repository for more information on what to do next.
Thanks for checking out Armstrong! This is a static template that you can edit to fit your needs, or remove entirely if you want something else.
Please check out our repository for more information on what to do next.


This website is the property of Foxtons Limited of Building One, Chiswick Park, 566 Chiswick High Road, London W4 5BE. By using this website you agree that you consent to and are bound by the following terms and conditions:
Copyright and Trade Marks
The content of this website are © Foxtons. Reproduction of part or all of the contents in any form is prohibited other than in accordance with the following permissions:
Licence to re-copy for Limited Purposes:
1) You acknowledge Foxtons as the source of the material. You must include such acknowledgement and the Foxtons web address (www.foxtons.co.uk) in the copy of the material, and
2) You must inform the third party that all the Terms and Conditions set out herewith apply to him/her and that he/she is bound by them.
This licence to re-copy does not permit incorporation of the material or any part of it in any other work, publication, or website whether in hard copy or electronic or any other form. In particular (but without limitation) no part of Foxtons website, including but not limited, to photographs, property details, virtual tours and/or floorplans may be distributed or copied for any commercial purpose. You may not frame this website without the express consent of Foxtons. The Foxtons logo is a trade mark registered in the name of Foxtons in the UK and other parts of the world. Reproduction of this trade mark other than in order to view this website is prohibited.
Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc.
The Land Registry data is Crown copyright and is reproduced with the permission of Land Registry under delegated authority from the Controller of HMSO.
Disclaimer
Foxtons takes all reasonable care to ensure that the information contained on this website is accurate, however, we cannot guarantee its accuracy and we reserve the right to change the information on this website (including these terms and conditions) at any time. You must therefore check these terms and conditions for any such changes each time you visit this website.
Foxtons makes no representations or warranties of any kind with respect to this website or the content contained on it, including any text, graphics, advertisements, links or other items. Further more, neither Foxtons nor any other contributor to this website make any representation or gives any warranty, condition, undertaking or term either expressed or implied as to the condition, quality, performance, accuracy, fitness for purpose, completeness or freedom from viruses of the content contained on this website or that such content will be accurate, up to date, uninterrupted or error free. Nothing on this website shall be regarded or taken as financial advice.
Law
The user confirms that the terms and conditions and use of this website shall be governed by the laws of England and Wales and that any and all disputes arising therefrom shall be subject to the exclusive jurisdiction of the English courts.
Anti-Money Laundering
Foxtons is committed to operating its business in a transparent and open manner consistent with our legal and regulatory obligations. We are aware that the real estate industry is a target for organised criminals seeking to launder the proceeds of criminal activity. We always seek to prevent this activity by cooperating fully with the authorities and reporting suspicious activity to National Crime Agency.
As part of this commitment we adopt a strict compliance of all applicable Anti Money Laundering rules, with specific emphasis on the Proceeds of Crime Act 2002, the Money Laundering Regulations 2007, the Bribery Act 2010 and the Terrorism Act 2000.
Foxtons policy commitment is applicable to all our customers, including vendors, buyers, landlords and tenants. As a result we obtain and hold for a period of at least five years evidence pertaining to our customers' identity and, where appropriate, we obtain proof of ownership of property and source/ destination of funds. We will be unable to proceed with any work on behalf of our customers if we are unable to obtain this information. Customers' identity will be subject to an electronic identity check, which may also include a credit check.
For a full list of acceptable identity documents, please click here.
Foxtons is registered and supervised by HM Revenue & Customs for compliance with the Money Laundering Regulations 2007.
Data Protection Act 1998
Foxtons respect and value the security and privacy of those of its contacts. Foxtons follows strict security procedures in the storage and disclosure of personal information in order to prevent unauthorised access. Personal Data is held on our contacts and administration database either because of work we have undertaken or are currently engaged in, or because we believe that clients may be interested in receiving material from us about our business and services. As such we hold client contact details and the history of our client relationship. This allows us to manage our client relationships effectively and target items of interest so that you do not receive unwanted material through the post.
In accordance with your rights under the Act, you may request the amendment of the personal information held or to cease receiving direct marketing materials. Foxtons does not sell, rent or deal in the personal information we hold. Information may, in the ordinary course of business, move between Foxtons, its associated companies and to our contractors, which may involve the transfer of data outside the European Economic Area.
Privacy policy
Foxtons is committed to ensuring that your privacy is protected. This is our Privacy Policy:
When you register with our website, you are required to provide an email address (as a minimum requirement). We will never spam you or send you unsolicited email.
In order to respond to your further requirements we need to know your name and contact telephone number. We and our associated companies may also wish to provide you with information which we think may be of interest to you. If you do not wish to receive this information you can manage communication preferences within your My Foxtons account, or inform us at<EMAIL_ADDRESS>We will not sell, rent, or otherwise provide any information you give to us to any third party except as necessary to complete the business between us.
By submitting your information you consent to the use of that information as set out in this Policy. If we change our Privacy Policy we will post the changes on this page, and may place notices on other pages of the website, so that you may be aware of the information we collect and how we use it at all times. We may also e-mail you should we make any changes so that you may consent to our use of your information in that way.
Geolocation
Certain devices can detect your approximate location, via latitude and longitude. The accuracy of this data is not in the control of Foxtons. If this feature is requested, Foxtons will prompt you to provide your permission to access your location data for the purposes of providing you with results or directions based on your current location. You can disable location settings within your browser or app.
Cookies and tracking
The Foxtons website and applications may collect anonymous data about how you use our services in order to help us improve future functionality.
Foxtons use Google Analytics, which is a web analysis service provided by Google. No data that personally identifies an individual (such as a name, email address or billing information) is tracked, collected or uploaded. Foxtons may collect and report on the adoption and usage of specific features, crashes and exceptions and other useful, anonymous metrics.
More about Google's Privacy Policy.
Opting out:
View our cookie policy to learn about our use of cookies, and how to manage or remove them.
How to contact Foxtons
We welcome your views about our website and our Privacy Policy. If you would like to contact us with any queries or comments please send an e-mail to<EMAIL_ADDRESS>Indemnity
You acknowledge that you are solely responsible for the use to which you put this website and all the results and information you obtain from it and that all warranties, conditions, undertakings, representations and terms whether expressed or implied, statutory or otherwise are hereby excluded to the fullest extent permitted by law.
Save in respect of liability for death or personal injury arising out of negligence or for fraudulent misrepresentation, we and all contributors to this website hereby disclaim to the fullest extent permitted by law all liability for any loss or damage including any consequential or indirect loss or damage incurred by you, whether arising in tort, contract or otherwise, and arising out of or in relation to or in connection with your access to or use of or inability to use this website.
Whilst we take every care to ensure that the standard of this website remains high and to maintain the continuity of it, we do not accept any ongoing obligation or responsibility to operate this website (or any particular part of it).
If any part of our terms and conditions is deemed to be unenforceable (including any provision in which we exclude our liability to you) the enforceability of any other part of these conditions will not be affected.
These terms and conditions and your use of this website are governed exclusively by English law.
This does not affect your statutory rights as a consumer.
Foxtons Limited is registered in England and Wales (registered number 01680058). Our registered office is at Building One, Chiswick Park, 566 Chiswick High Road, London, W4 5BE.


Palindrome
问题描述 :
A palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the minimal number of characters to be inserted into the string in order to obtain a palindrome.
As an example, by inserting 2 characters, the string "Ab3bd" can be transformed into a palindrome ("dAb3bAd" or "Adb3bdA"). However, inserting fewer than 2 characters does not produce a palindrome.
输入:
Your program is to read from standard input. The first line contains one integer: the length of the input string N, 3 <= N <= 5000. The second line contains one string with length N. The string is formed from uppercase letters from ‘A’ to ‘Z’, lowercase letters from ‘a’ to ‘z’ and digits from ’0′ to ’9′. Uppercase and lowercase letters are to be considered distinct.
输出:
Your program is to write to standard output. The first line contains one integer, which is the desired minimal number.
样例输入:
5 Ab3bd
样例输出:
2
#include <iostream> using namespace std; char a[5010], b[5010]; int dp[2][5010]; int main() { int n; while(scanf("%d", &n) != EOF) { getchar(); for(int i = 0; i < n; ++i) { scanf("%c", a + i); b[n - i - 1] = a[i]; } memset(dp, 0, sizeof(dp)); for(int i = 1; i <= n; ++i) for(int j = 1; j <= n; ++j) if(a[i-1] == b[j-1]) dp[i%2][j] = dp[(i-1)%2][j-1] + 1; else dp[i%2][j] = max(dp[(i-1)%2][j], dp[i%2][j-1]); printf("%d\n", n - dp[n%2][n]); } return 0; }
滚动数组，soga
解题报告转自：http://www.cnblogs.com/georgechen-ena/articles/2099590.html
(adsbygoogle = window.adsbygoogle || []).push({});
Good task for the group. Hold it up for every yeara??s winner. This is a excellent oppotunity for a lot more enhancement. Indeed, obtaining far better and much better is constantly the crucial. Just like my pal suggests on the truth about ab muscles, he just keeps obtaining much better.
A的话不是不能避免冲突么？感觉出题者在考察是否考虑了冲突解决办法？
正确
int L[m+1][n+1];这样定义出错，这个在gcc上可以编译通过 在VS上不行 应该改为new 或者vector
不错，值得借鉴
已修正
什么破题，题意好难懂啊
算法还停留在大学的知识中
I like your publish. It is great to see you verbalize from the coronary heart and clarity on this essential subject matter can be easily noticed.
对，还是这种实现比较好理解。虽然效率有点低
代码不错，赞一个！
mark, 很巧妙的实现！
目前为止见过的最易懂的一个，多谢分享
目测会火


Real U.S. GDP, quarterly change at a seasonally adjusted annualized rate
contributions to quarterly GDP change, by select sector
Contributors to change may not total full GDP movement, due to rounding