Tag Archives: data

Idea: Building A Quantum Interface Card (QIC)

A few years ago, an idea came to me regarding quantum entanglement and networking/communication technology.  After some time and research into trying to patent the idea, I found that others had similar ideas but were not at all interested in acting on its development.  To this end, I thought I might share my idea with the world, freely, in the hopes that perhaps someone, someday might find it useful in the furthering of how we not only communicate digitally, but how we share information as a whole.  The idea is as follows and is described using the simplest terms possible not to loose viewers not currently versed in quantum theory.  This post will also contain a simple entanglement primer.

Understanding Quantum Entanglement

To start, one must understand some simple quantum theory observations.  The first, particles entangled at the quantum level, retain their entangled state regardless of distance between said particles.  These particles, share an interesting state which can be described by the following.

Imagine for a moment that in front of you sat a quantum blender.  This magical device would take two particles, blend them up and spit out entangled resulting particles.  Now, imagine that the quantum particles where actually two tennis balls.  One orange and one green.  Once the tennis balls have been placed in the blender and turned on, the resulting particles could be observed as having the following characteristics:

The first ball which was orange, becomes half orange and half green.
The second ball which as green, becomes half green and half orange, in that order and yes, the order does matter and here’s why.

The state of the first tennis ball will always be the exact opposite state of the second and vice versa.  If the first tennis ball is imagined as being rotated 180 degrees, the second tennis ball could be visualized as rotating the opposite direction and have the opposite state.  This is where the importance of quantum communication begins.

If the state of the first tennis ball, when it’s orange state facing you could be thought of as 1, then the opposite state could be expressed as 0.  At the same time that the first ball’s state is 0 the second ball’s  state would be 1.  This is important because synchronization of the two states requires that one end of the entangled particles become inverted or not-ed.  This would render a synchronous state so that when the first tennis ball is facing with a state of 1, the second would also have a state of 1 and once again when changed, vice versa (ie. Orange:1 = Green:1, Orange:0 = Green:0).

Hopefully all of the above helps in understanding of the quantum theory being employed here.  If not, please feel free to ask questions in the comments and I will do my best to answer them.  Also, please keep in mind the idea above is a simplified example to only be used as a reference or mental model for understanding what’s to be explained in the development of a QIC.

Building A Quantum Interface Card (QIC)

In quantum physics it is understood that the sheer act of observing a quantum system changes the state of the system and this must be taken into account.  Currently two large hurdles exist at the time of this writing, the first of which is stabilizing a quantum particle or particles for a long duration of time.  The second, is creating a non-disruptive observance of a quantum particle or at the very least, a system of observance by which the state can be obtained from a quantum system before/during disruption as to obtain the correct state of the particle at the point in time of observance.

The Client Interface

In this model, the client interface could be thought of as a hand held device such as a phone or other user machine such as a desktop/laptop computer, tablet, etc..

The Service Interface

In this model, the service interface could be thought of as the side in which has direct or near direct communication with the service provider or access point into a provider infrastructure such as a data center.

Implementation

The implementation for the QIC requires one or more particles to be entangled at the quantum level and stabilized, with client particle(s) residing in the device used by the end user (ie. phone, tablet, computer, etc.) and the service particles remaining at the data center or provider’s data hub.  Information exchanged from the service end will be instantaneously observed by the client and vice versa.  A protocol will need to be established whereby client communication is recognized and service communication is recognized and handled to avoid collisions.  The simplest approach that comes to mind is to have a series of observed particles dedicated as client to service, and another dedicated as service to client.  This would allow for truly bidirectional and parallel communication.  Information exchanged in this manner could initially be interpreted using simple states such as 1 and 0.  By determining an initial quantum state, any state changes thereafter would determine the transmission state of either 1 or 0 (1 -> 0, 0 -> 1).  Current compression and optimization techniques used for optimizing and encrypting network communication could still be used although, being that this implementation takes place at the quantum level, one might argue that for the time being at least, such techniques may not be necessary for quite some time, if at all.

Realization

Once realized, quantum communication opens up an entirely new avenue of real time information sharing easily measured in the gigabyte, terabyte and potentially in the petabyte per second range.  This caliber of wireless data sharing would allow any device supporting a QIC to download/upload information far beyond what current wired/wireless technology allows, thus putting new bottlenecks on the side of the service provider and the speed in which the client can actually process and persist the data as received.

Other applications for QIC communication go beyond terrestrial technology and into that of deep space communication, allowing instantaneous communication with deep space vehicles and probes.

Conclusion

The above idea expressed reflects my vision for the future of wireless communication in the hopes that it be put into practical use.  If you use this idea, please mention me as one of the authors and I wish you the very best of luck.  Please feel free to ask any questions regarding any of the information listed above.  Thanks.

D3 and jQuery Interoperability

D3 and jQuery utilize distinctly different approaches to node manipulation and internal array storage. However, there are mechanisms available for converting between D3 and jQuery, and vice versa.

D3 and jQuery Internals

Let’s assume the following HTML structure:

<div class="test-node">Test One</div>
<div class="test-node">Test Two</div>
<div class="test-node">Test Three</div>
<div class="test-node">Test Four</div>

Now let’s retrieve the “test-node” elements with jQuery:

var testNodes = $(".test-node");
console.log(testNodes);

Console Log

As can be seen above, jQuery stores the selected elements in a first level array, making elements accessible by testNodes[0…3] as expected.  Now let’s examine the D3 equivalent:

var testNodes = d3.selectAll(".test-node");
console.log(testNodes);

Console Log

When using D3, the selected elements get stored in a second level array making the elements accessible by testNode[0][0…n].

Converting from jQuery to D3

var $testNodes = $(".test-node");  //jquery
var testNodes = d3.selectAll( $testNodes.toArray() ); //d3
console.log(testNodes);

Console Log

The above first retrieves the nodes using standard jQuery selector syntax.  Next the “toArray()” method is called returning the native array of selected elements.  Finally the “d3.selectAll()” method is invoked using the native array as the argument.  This forces the native element array into the second level array of D3.

Converting from D3 to jQuery

var testNodes = d3.selectAll(".test-node");
var $testNodes = $(testNodes[0]);
console.log($testNodes);

Console Log

The above first retrieves the nodes using D3 selector syntax.  Next the first level D3 array is used as the argument passed into the jQuery selector.

Class Addition/Removal

Adding and removing a class in jQuery is pretty straightforward:

$(".test-node").addClass("selected"); //add class "selected"
$(".test-node").removeClass("selected"); //remove class "selected"

The same performed in D3 is performed using the following:

d3.selectAll(".test-node").classed("selected", true); //add class "selected"
d3.selectAll(".test-node").classed("selected", false); //remove class "selected"

Data/Datum

D3 has a very elegant data system whereby information can be bound to elements by use of the “datum()” method.

D3 Datum

Let’s examine the following:

var nodes = d3.selectAll(".test-node")
    .datum({key: "hello", value: "world"})
    .append("span");
 
console.log(nodes);

Console Log

The above example selects all of the “.test-node” div classed elements utilizing D3, initializes a data structure/object and passes this structure/object to the “span” elements which get appended to all the matching “.test-node” div classed elements.  This “datum()” method passes the data structure/object to the “span” elements using a property called “__data__”.  As displayed above, the __data__ property has the structure of:

__data__: {
    key: "hello",
    value: "world"
}

The “__data__” property can be accessed directly using second level array syntax (ie. d3.selectAll(“span”)[0][0…n].__data__) or it can be utilized as a default argument passed into nearly all D3 selector instance methods.  Let’s examine an instance method where this takes place:

var nodes = d3.selectAll(".test-node")
    .datum({key: "hello", value: "world"})
    .append("span")
    .text(function(d){
        return d.key + " " + d.value;
    });

In the above example, the only difference from the previous example is the instance method “text()”, whereby the argument passed is a function.  This function defines an argument “d” which D3 passes to these type of instance methods automatically.  The “d” argument being the actual data/datum used to initialize the “span” elements.  The body of the text function returns the string “hello world” using the data/datum, thusly setting the text of the “span” elements to “hello world”.

jQuery Data

jQuery has a simple mechanism for adding arbitrary data to elements by use of the “data()” method.  Let’s examine the following:

var nodes = $(".test-node")
    .append("span")
    .data("datum", {key: "hello", value: "world"});
 
console.log(nodes);
console.log($.cache);

Console Log

In the above example, the “.test-node” elements are retrieved, “span” elements are appended and the datum {key: “hello”, value: “world”} is added to the data.  The console output reveals that the datum is stored in the $.cache in jQuery.

Exchanging D3 Datum with jQuery

Now that we’ve seen how both D3 and jQuery store data/datum, let’s exchange D3 datum with jQuery:

//D3
var nodes = d3.selectAll(".test-node")
    .datum({key: "hello", value: "world"})
    .append("span");
 
console.log(nodes);
 
//jQuery
var $nodes = $(nodes[0]);
$nodes.each(function(){
    $(this).data("datum", $(this).prop("__data__"));
});
 
console.log($nodes);
console.log($.cache);

Console LogIn this example, we first select the “.test-node” classed elements using D3, append “span” elements using the datum/data specified.  Next, we create a jQuery selector using the first level array of the D3 selector.  Using the jQuery selector, the nodes are iterated over in “each” and the “data()” of the jQuery element is set to the “__data__” property of the D3 element.

Exchanging jQuery Data With D3

Now, let’s exchange jQuery data with D3 using a similar technique to the previous example:

//jQuery
var $nodes = $(".test-node")
    .append("span")
    .data("datum", {key: "hello", value: "world"});
 
console.log($nodes);
console.log($.cache);
 
//D3
var nodes = d3.selectAll($nodes.toArray())
    .datum({})
    .each(function(d){
        this.__data__ = $(this).data("datum");
    });
 
console.log(nodes);

Console LogIn the above example, the “.test-node” elements are selected using jQuery, the span child elements are appended and the “data()” method is used to store the “datum” {key: “hello”, value: “world”}.  Next, the D3 selector is populated using the “toArray()” method of the jQuery selector, the “datum()” method is used to initialize an empty data object and finally the nodes are iterated over and the __data__ property is populated with the jQuery data “datum”.

Conclusion

Both frameworks are very powerful and can live together in peace.  Information can be exchanged freely between the the two frameworks utilizing these or similar techniques.