Skip to content

Latest commit

 

History

History

function

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Constant and Balanced Functions

This code shows the difference between a constant and a balanced function

Running the sample

To run this application, simply run mvn clean javafx:run

The expected outcome on the console looks similar to this

f2 is a balanced function
f4 is a constant function
f2 is a balanced function
f2 is a balanced function
f3 is a balanced function
f3 is a balanced function
f4 is a constant function
f1 is a constant function
f2 is a balanced function
f1 is a constant function

What it is doing

In this 100% classic sample, a number of constant and balanced functions are created. We need 2 evaluations before we can determine a random function is contant or balanced.

You can learn more about this sample in Chapter 9 of Quantum Computing for Java Developers. It is discussed in 9.2: "Properties of functions"